Skip to content

Commit

Permalink
Merge pull request #1625 from planetary-social/notify-slack-on-build-…
Browse files Browse the repository at this point in the history
…failure

Add a workflow that notifies slack when a deployment failes
  • Loading branch information
mplorentz authored Oct 11, 2024
2 parents 0d55436 + 110f3da commit e4a6b07
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/notify-slack-on-failure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
workflow_run:
workflows: ["testflight-deploy.yml", "testflight-dev-deploy.yml", "testflight-staging-deploy.yml"]
types:
- completed

jobs:
notify:
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
runs-on: ubuntu-latest
steps:
- name: Send notification to Slack
uses: slackapi/[email protected]
with:
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
custom-payload: |
{
"text": "GitHub Action *${{ github.event.workflow_run.name }}* has failed in the *${{ github.repository }}* repository.\n<${{ github.event.workflow_run.html_url }}|View the workflow run>"
}

0 comments on commit e4a6b07

Please sign in to comment.