forked from taichi-dev/taichi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Add taichi bot to send message to slack on master failure (taich…
…i-dev#6501) Issue: # ### Brief Summary Mooooore automation
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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": "Failed at commit : `${{ github.event.workflow_run.head_commit.message }}`" | ||
} | ||
}, | ||
] | ||
} |