From 2d202ae0f7e00e9469fa2ce75806acaf39bd48ef Mon Sep 17 00:00:00 2001 From: Riqwan Thamir Date: Tue, 24 Sep 2024 18:56:40 +0200 Subject: [PATCH] chore: notify slack on failed release (#9287) --- .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ced86aaa60..fa12912d0e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,3 +38,32 @@ jobs: uses: changesets/action@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Post failure to Slack channel + if: failure() + id: slack + uses: slackapi/slack-github-action@v1.23.0 + with: + channel-id: "releases" + payload: | + { + "blocks":[ + { + "type": "header", + "text": { + "type": "plain_text", + "text": "Failed to release! ⛔" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "${{ github.event.release.html_url }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_RELEASE }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK