[Job] Slack Notification of Path to Live Workflow Failure #328
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
name: "[Job] Slack Notification of Path to Live Workflow Failure" | |
on: | |
workflow_run: | |
workflows: [Path To Live] | |
types: [completed] | |
jobs: | |
on-success: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- run: echo 'The triggering workflow passed' | |
on-failure: | |
name: Post slack message | |
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | |
uses: ./.github/workflows/slack_job.yml | |
with: | |
channel-id: opg-mlpa-dev | |
payload: | | |
{ | |
"blocks": [ | |
{ | |
"type": "header", | |
"text": { | |
"type": "plain_text", | |
"text": ":exclamation: Path to Live workflow is failing", | |
"emoji": true | |
} | |
}, | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "Paging <!subteam^S03RPSWH0KF>" | |
} | |
} | |
] | |
} | |
secrets: | |
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} # pragma: allowlist secret |