generated from salesforcecli/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: sync github actions failure-slack [skip-validate-pr] [skip ci] (…
…#161) Authored via Leif
- Loading branch information
SF-CLI-BOT
authored
Sep 15, 2022
1 parent
1bb8b30
commit bf47466
Showing
1 changed file
with
43 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,43 @@ | ||
name: failureNotifications | ||
|
||
on: | ||
workflow_run: | ||
workflows: | ||
- version, tag and github release | ||
- publish | ||
types: | ||
- completed | ||
|
||
jobs: | ||
failure-notify: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | ||
steps: | ||
- name: Announce Failure | ||
id: slack | ||
uses: slackapi/[email protected] | ||
env: | ||
# for non-CLI-team-owned plugins, you can send this anywhere you like | ||
SLACK_WEBHOOK_URL: ${{ secrets.CLI_ALERTS_SLACK_WEBHOOK }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
with: | ||
payload: | | ||
{ | ||
"text": "${{ github.event.workflow_run.name }} failed: ${{ github.event.workflow_run.repository.name }}", | ||
"blocks": [ | ||
{ | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": ":bh-alert: `${{ github.event.workflow_run.name }}` failed: ${{ github.event.workflow_run.repository.name }} :bh-alert:" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "Repo: ${{ github.event.workflow_run.repository.html_url }}\nWorkflow name: `${{ github.event.workflow_run.name }}`\nJob url: ${{ github.event.workflow_run.html_url }}" | ||
} | ||
} | ||
] | ||
} |