Skip to content

Commit

Permalink
[ci] Add taichi bot to send message to slack on master failure (taich…
Browse files Browse the repository at this point in the history
…i-dev#6501)

Issue: #

### Brief Summary
Mooooore automation
  • Loading branch information
ailzhang authored Nov 3, 2022
1 parent 8e5e002 commit b6b4317
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/notify_on_failure.yml
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 }}`"
}
},
]
}

0 comments on commit b6b4317

Please sign in to comment.