Skip to content

Commit bc12a9d

Browse files
committed
fix(checkpoint-sync): validate beacon node URL format
The action now validates the beacon node URL to ensure it starts with either 'http://' or 'https://'. If the URL is invalid, the action will exit with an error message.
1 parent a2585e9 commit bc12a9d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/actions/checkpoint-sync/action.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ runs:
2929
- name: Configure checkpointz
3030
shell: bash
3131
run: |
32-
# Strip trailing slash from the beacon node URL
33-
beacon_node_url="${{ inputs.beacon_node_url }}"
34-
if [[ "$beacon_node_url" == *"/" ]]; then
35-
beacon_node_url="${beacon_node_url%/}"
32+
# Check if beacon node url is valid
33+
if [[ ! "${{ inputs.beacon_node_url }}" =~ ^https?:// ]]; then
34+
echo "Invalid beacon node URL"
35+
exit 1
3636
fi
37+
3738
cat <<EOF > checkpointz.yaml
3839
global:
3940
listenAddr: ":5555"
@@ -42,7 +43,7 @@ runs:
4243
beacon:
4344
upstreams:
4445
- name: state-provider
45-
address: "${beacon_node_url}"
46+
address: "${{ inputs.beacon_node_url }}"
4647
timeoutSeconds: 30
4748
dataProvider: true
4849
checkpointz:

0 commit comments

Comments
 (0)