Skip to content

Commit

Permalink
fix(checkpoint-sync): validate beacon node URL format
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
samcm committed Feb 21, 2025
1 parent a2585e9 commit bc12a9d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/actions/checkpoint-sync/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ runs:
- name: Configure checkpointz
shell: bash
run: |
# Strip trailing slash from the beacon node URL
beacon_node_url="${{ inputs.beacon_node_url }}"
if [[ "$beacon_node_url" == *"/" ]]; then
beacon_node_url="${beacon_node_url%/}"
# Check if beacon node url is valid
if [[ ! "${{ inputs.beacon_node_url }}" =~ ^https?:// ]]; then
echo "Invalid beacon node URL"
exit 1
fi
cat <<EOF > checkpointz.yaml
global:
listenAddr: ":5555"
Expand All @@ -42,7 +43,7 @@ runs:
beacon:
upstreams:
- name: state-provider
address: "${beacon_node_url}"
address: "${{ inputs.beacon_node_url }}"
timeoutSeconds: 30
dataProvider: true
checkpointz:
Expand Down

0 comments on commit bc12a9d

Please sign in to comment.