This will allow external tools to be notified when there are updates on the main branch so they can request the data from the repo
24 lines
508 B
YAML
24 lines
508 B
YAML
name: Call Webhooks on Main Push
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
call-webhooks:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check and call webhooks
|
|
env:
|
|
WEBHOOK_URLS: ${{ secrets.WEBHOOK_URLS }}
|
|
run: |
|
|
if [ -n "$WEBHOOK_URLS" ]; then
|
|
IFS=',' read -ra URLS <<< "$WEBHOOK_URLS"
|
|
for url in "${URLS[@]}"; do
|
|
curl -X POST "$url"
|
|
done
|
|
else
|
|
echo "No webhooks to call."
|
|
fi
|