-
Notifications
You must be signed in to change notification settings - Fork 2.3k
42 lines (41 loc) · 1.14 KB
/
notify_on_failure.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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) }}
}
}
]
}