From 1f10b6532af520b3e043a73c63e9a19599e13a93 Mon Sep 17 00:00:00 2001 From: Aaron Powell Date: Fri, 11 Jul 2025 10:32:03 +1000 Subject: [PATCH] Adding an action to invoke webhooks 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 --- .github/workflows/webhook-caller.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/webhook-caller.yml diff --git a/.github/workflows/webhook-caller.yml b/.github/workflows/webhook-caller.yml new file mode 100644 index 0000000..13c0143 --- /dev/null +++ b/.github/workflows/webhook-caller.yml @@ -0,0 +1,23 @@ +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