Skip to content

Commit dfe9090

Browse files
committed
Addressing some feedback
1 parent 1f10b65 commit dfe9090

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/webhook-caller.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
contents: read
10+
actions: none
11+
checks: none
12+
deployments: none
13+
issues: none
14+
discussions: none
15+
packages: none
16+
pull-requests: none
17+
repository-projects: none
18+
security-events: none
19+
statuses: none
20+
821
jobs:
922
call-webhooks:
1023
runs-on: ubuntu-latest
@@ -16,7 +29,14 @@ jobs:
1629
if [ -n "$WEBHOOK_URLS" ]; then
1730
IFS=',' read -ra URLS <<< "$WEBHOOK_URLS"
1831
for url in "${URLS[@]}"; do
19-
curl -X POST "$url"
32+
if [[ "$url" =~ ^https:// ]]; then
33+
if ! curl -f --max-time 30 --retry 3 -X POST "$url"; then
34+
echo "Webhook call failed for: $url" >&2
35+
echo "Skipping invalid webhook URL (must start with https://): $url" >&2
36+
exit 1
37+
else
38+
echo "Skipping invalid webhook URL (must start with https://): $url" >&2
39+
fi
2040
done
2141
else
2242
echo "No webhooks to call."

0 commit comments

Comments
 (0)