From 50ce88b17dadba7c5459532776c27d6e8a9d31a7 Mon Sep 17 00:00:00 2001 From: Patrick Dodgen Date: Tue, 23 Jun 2026 15:36:23 -0600 Subject: [PATCH] ci: add shared notify-ci-failure reusable workflow Input-driven Slack notifier called by each repo's workflow_run watcher. Posts which workflow failed + commit + run link to the org SLACK_WEBHOOK_URL. Lets a repo surface ANY check failing on main (build, phpstan, tests, cs-fixer, the nightly common bump itself), not just Build. --- .github/workflows/notify-ci-failure.yaml | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/notify-ci-failure.yaml diff --git a/.github/workflows/notify-ci-failure.yaml b/.github/workflows/notify-ci-failure.yaml new file mode 100644 index 0000000..e11b0ec --- /dev/null +++ b/.github/workflows/notify-ci-failure.yaml @@ -0,0 +1,42 @@ +name: Notify CI Failure +on: + workflow_call: + inputs: + workflow: + description: "Name of the workflow that failed" + required: true + type: string + run_url: + description: "URL of the failed run" + required: true + type: string + head_sha: + description: "Commit SHA the failed run was for" + required: true + type: string + branch: + required: false + type: string + default: "" + actor: + required: false + type: string + default: "" + secrets: + slack_webhook_url: + required: true + +jobs: + notify: + name: Notify Slack + runs-on: ubuntu-latest + steps: + - name: Post failure to Slack + uses: slackapi/slack-github-action@v2 + with: + webhook: ${{ secrets.slack_webhook_url }} + webhook-type: incoming-webhook + payload: | + { + "text": ":rotating_light: *${{ github.repository }}* — *${{ inputs.workflow }}* failed on `${{ inputs.branch }}`\n*By:* ${{ inputs.actor }} · *Commit:* <${{ github.server_url }}/${{ github.repository }}/commit/${{ inputs.head_sha }}|${{ inputs.head_sha }}>\n<${{ inputs.run_url }}|View failed run>" + }