-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9d2417
commit 4ca4921
Showing
1 changed file
with
58 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,58 @@ | ||
name: Notify on `main` Failure | ||
on: | ||
workflow_run: | ||
workflows: [Failing Workflow] | ||
types: [completed] | ||
branches: [main] | ||
|
||
jobs: | ||
on-failure: | ||
runs-on: ubuntu-latest | ||
if: github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'timed_out' | ||
steps: | ||
- uses: slackapi/slack-github-action@v1.24.0 | ||
with: | ||
payload: | | ||
{ | ||
"text": "main branch failure in CI ", | ||
"blocks": [ | ||
{ | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": ":warning: `main` branch failure in CI ", | ||
"emoji": true | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "View run details: " | ||
}, | ||
"accessory": { | ||
"type": "button", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "Run Details", | ||
"emoji": true | ||
}, | ||
"value": "clicked_1", | ||
"url": "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}", | ||
"action_id": "button-action" | ||
} | ||
}, | ||
{ | ||
"type": "context", | ||
"elements": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "Linked Repo <${{github.server_url}}/${{github.repository}}|${{github.repository}}> | <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure>" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.MOSHE_PERSONAL_SLACK_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |