From add3103205580709221e55bee61ff83951fb8da3 Mon Sep 17 00:00:00 2001 From: ugniussmaizys Date: Mon, 27 Jul 2026 13:38:34 +0300 Subject: [PATCH] ci: alert Slack on release failure Add a notify-failure job to build-release.yaml that posts to the PLATFORM_INCIDENT_SLACK_CHANNEL_WEBHOOK Slack channel only when the release fails (guarded by if: failure()). Successful releases are unaffected. --- .github/workflows/build-release.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index f395c88..5cc9ab0 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -56,3 +56,31 @@ jobs: env: GITHUB_TOKEN: ${{ steps.get_token.outputs.token }} GORELEASER_CURRENT_TAG: ${{ steps.bump.outputs.new_tag }} + + notify-failure: + needs: [release] + if: failure() + runs-on: ubuntu-latest + steps: + - name: Notify Slack on release failure + uses: slackapi/slack-github-action@v2.1.0 + with: + errors: true + webhook: ${{ secrets.PLATFORM_INCIDENT_SLACK_CHANNEL_WEBHOOK }} + webhook-type: incoming-webhook + payload: | + text: ":rotating_light: Release failed in ${{ github.repository }}" + blocks: + - type: section + text: + type: mrkdwn + text: | + :rotating_light: *Release failed:* `${{ github.repository }}` + *Commit:* <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}> + - type: actions + elements: + - type: button + text: + type: plain_text + text: "View failed run" + url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"