Notification for master failure #2593
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Notification for master failure | |
on: | |
workflow_run: | |
workflows: [Build and Test] | |
types: [completed] | |
branches: [master] | |
jobs: | |
on-failure: | |
name: Send message to slack | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | |
steps: | |
- name: Post to slack channel | |
id: slack | |
uses: slackapi/[email protected] | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.TAICHI_BOT_TOKEN }} | |
with: | |
# channel #build | |
channel-id: 'C02BDNMG8MR' | |
payload: | | |
{ | |
"blocks": [ | |
{ | |
"type": "header", | |
"text": { | |
"type": "plain_text", | |
"text": ":bbb: Master is on fire", | |
"emoji": true | |
} | |
}, | |
{"type": "divider"}, | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": ${{ toJSON(github.event.workflow_run.html_url) }} | |
} | |
} | |
] | |
} |