Skip to content

Commit fd508eb

Browse files
committed
Add Slack notification to the release workflow
1 parent 3ef386d commit fd508eb

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/release.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,23 @@ jobs:
6868
git tag -f "${COMPONENT}/v${MAJOR}"
6969
git tag -f "${COMPONENT}/v${MAJOR}.${MINOR}"
7070
git push origin -f "${COMPONENT}/v${MAJOR}" "${COMPONENT}/v${MAJOR}.${MINOR}"
71+
72+
notify-slack:
73+
name: Notify about release failure
74+
needs: [release]
75+
if: failure()
76+
runs-on: ubuntu-latest
77+
78+
steps:
79+
- name: Notify Slack
80+
uses: FlowFuse/github-actions-workflows/actions/slack_notification@slack_notification/v1
81+
with:
82+
bot-token: ${{ secrets.SLACK_GHBOT_TOKEN }}
83+
mode: channel
84+
blocks: |
85+
[
86+
{ "type": "header", "text": { "type": "plain_text", "text": ":x: ${{ github.workflow }} workflow failed", "emoji": true } },
87+
{ "type": "divider" },
88+
{ "type": "section", "text": { "type": "mrkdwn", "text": "<${{ github.server_url }}/${{ github.repository }}/actions/workflows/release.yaml|${{ github.workflow }}> workflow failed to complete successfully." } },
89+
{ "type": "section", "text": { "type": "mrkdwn", "text": "*Workflow run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View>" } }
90+
]

0 commit comments

Comments
 (0)