Skip to content

[Job] Slack Notification of Path to Live Workflow Failure #328

[Job] Slack Notification of Path to Live Workflow Failure

[Job] Slack Notification of Path to Live Workflow Failure #328

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