From 84850a5316453f0803efdd0033bcf3ed58278540 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 23 Jul 2026 06:15:51 +0000 Subject: [PATCH] ci: alert #alerts-github on CI and Release failures Co-authored-by: Asadullo Ganiev --- .github/workflows/slack-alerts.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/slack-alerts.yml diff --git a/.github/workflows/slack-alerts.yml b/.github/workflows/slack-alerts.yml new file mode 100644 index 00000000..94420887 --- /dev/null +++ b/.github/workflows/slack-alerts.yml @@ -0,0 +1,26 @@ +name: Slack Alerts + +# Posts to #alerts-github when a monitored workflow fails. Requires the +# SLACK_ALERTS_WEBHOOK_URL secret: a Slack incoming webhook bound to the +# #alerts-github channel (Slack app > Incoming Webhooks). +on: + workflow_run: + workflows: [CI, Release] + types: [completed] + +jobs: + notify: + # Alert on failed pushes to main, releases, and manual runs; stay quiet + # for pull request CI, which is visible on the PR itself. + if: >- + github.event.workflow_run.conclusion == 'failure' && + github.event.workflow_run.event != 'pull_request' + runs-on: ubuntu-latest + steps: + - name: Post failure to Slack + uses: slackapi/slack-github-action@v2 + with: + webhook: ${{ secrets.SLACK_ALERTS_WEBHOOK_URL }} + webhook-type: incoming-webhook + payload: | + text: ":rotating_light: *${{ github.event.workflow_run.name }}* failed in `${{ github.repository }}` on `${{ github.event.workflow_run.head_branch }}` (triggered by ${{ github.event.workflow_run.actor.login }})\n<${{ github.event.workflow_run.html_url }}|View failed run>"