Addressing some feedback
This commit is contained in:
parent
1f10b6532a
commit
dfe9090923
22
.github/workflows/webhook-caller.yml
vendored
22
.github/workflows/webhook-caller.yml
vendored
@ -5,6 +5,19 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
actions: none
|
||||||
|
checks: none
|
||||||
|
deployments: none
|
||||||
|
issues: none
|
||||||
|
discussions: none
|
||||||
|
packages: none
|
||||||
|
pull-requests: none
|
||||||
|
repository-projects: none
|
||||||
|
security-events: none
|
||||||
|
statuses: none
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
call-webhooks:
|
call-webhooks:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -16,7 +29,14 @@ jobs:
|
|||||||
if [ -n "$WEBHOOK_URLS" ]; then
|
if [ -n "$WEBHOOK_URLS" ]; then
|
||||||
IFS=',' read -ra URLS <<< "$WEBHOOK_URLS"
|
IFS=',' read -ra URLS <<< "$WEBHOOK_URLS"
|
||||||
for url in "${URLS[@]}"; do
|
for url in "${URLS[@]}"; do
|
||||||
curl -X POST "$url"
|
if [[ "$url" =~ ^https:// ]]; then
|
||||||
|
if ! curl -f --max-time 30 --retry 3 -X POST "$url"; then
|
||||||
|
echo "Webhook call failed for: $url" >&2
|
||||||
|
echo "Skipping invalid webhook URL (must start with https://): $url" >&2
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "Skipping invalid webhook URL (must start with https://): $url" >&2
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
echo "No webhooks to call."
|
echo "No webhooks to call."
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user