Skip to content

Commit 79b62d9

Browse files
authored
Merge pull request #416 from salesforcecli/sync-failure-notifications
chore: sync github actions failure-slack
2 parents 66c60e8 + 7eafa80 commit 79b62d9

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

.github/failureNotifications.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: failureNotifications
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- version, tag and github release
7+
- publish
8+
types:
9+
- completed
10+
11+
jobs:
12+
failure-notify:
13+
runs-on: ubuntu-latest
14+
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
15+
steps:
16+
- name: Announce Failure
17+
id: slack
18+
uses: slackapi/[email protected]
19+
env:
20+
SLACK_WEBHOOK_URL: ${{ secrets.CLI_ALERTS_SLACK_WEBHOOK }}
21+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
22+
with:
23+
payload: |
24+
{
25+
"text": "${{ github.event.workflow_run.name }} failed: ${{ github.event.workflow_run.repository.name }}",
26+
"blocks": [
27+
{
28+
"type": "header",
29+
"text": {
30+
"type": "plain_text",
31+
"text": "${{ github.event.workflow_run.name }} failed: ${{ github.event.workflow_run.repository.name }}"
32+
}
33+
},
34+
{
35+
"type": "section",
36+
"text": {
37+
"type": "mrkdwn",
38+
"text": "repo: ${{ github.event.workflow_run.repository.html_url }}\nworkflow name:${{ github.event.workflow_run.name }}\njob url: ${{ github.event.workflow_run.html_url }}"
39+
}
40+
}
41+
]
42+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: failureNotifications
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- version, tag and github release
7+
- publish
8+
types:
9+
- completed
10+
11+
jobs:
12+
failure-notify:
13+
runs-on: ubuntu-latest
14+
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
15+
steps:
16+
- name: Announce Failure
17+
id: slack
18+
uses: slackapi/[email protected]
19+
env:
20+
# for non-CLI-team-owned plugins, you can send this anywhere you like
21+
SLACK_WEBHOOK_URL: ${{ secrets.CLI_ALERTS_SLACK_WEBHOOK }}
22+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
23+
with:
24+
payload: |
25+
{
26+
"text": "${{ github.event.workflow_run.name }} failed: ${{ github.event.workflow_run.repository.name }}",
27+
"blocks": [
28+
{
29+
"type": "header",
30+
"text": {
31+
"type": "plain_text",
32+
"text": "${{ github.event.workflow_run.name }} failed: ${{ github.event.workflow_run.repository.name }}"
33+
}
34+
},
35+
{
36+
"type": "section",
37+
"text": {
38+
"type": "mrkdwn",
39+
"text": "repo: ${{ github.event.workflow_run.repository.html_url }}\nworkflow name:${{ github.event.workflow_run.name }}\njob url: ${{ github.event.workflow_run.html_url }}"
40+
}
41+
}
42+
]
43+
}

0 commit comments

Comments
 (0)