-
Notifications
You must be signed in to change notification settings - Fork 53
46 lines (44 loc) · 1.37 KB
/
ci-notify.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
43
44
45
46
name: ci notify
# run after all completed workflows on main
on:
workflow_run:
workflows: ["*"]
branches: [main,release*]
types: [completed]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Notify Slack
uses: slackapi/slack-github-action@v1.24.0
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
with:
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "🚨 CI failed on `${{ github.event.repository.name }}:${{ github.event.workflow_run.head_branch }}`."
}
},
{
"type": "context",
"elements": [
{
"type": "image",
"image_url": "https://upload.wikimedia.org/wikipedia/commons/4/43/Minimalist_info_Icon.png",
"alt_text": "images"
},
{
"type": "mrkdwn",
"text": "url: ${{ github.event.workflow_run.html_url }}"
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK