Skip to content

Commit

Permalink
chore: send Slack notifications when acceptance tests fail on main (#…
Browse files Browse the repository at this point in the history
…240)

* Start sending Slack notification

* Test only running on fail

* Only notify on main

* Confirm it does not notify on success

* Only run on main
  • Loading branch information
ldhenry authored Dec 6, 2024
1 parent cdff57d commit 9265ae0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,20 @@ jobs:
printf "Tests failed or workflow cancelled:\n\n${{ toJSON(needs) }}"
exit 1
fi
notify-slack-on-failure:
name: Notify Slack on Failures
if: failure() && github.ref == 'refs/heads/main'
needs:
- build
- generate
- test
runs-on: ubuntu-latest
steps:
- name: Send GitHub trigger payload to Slack Workflow Builder
id: slack
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
payload-delimiter: "_"
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: webhook-trigger

0 comments on commit 9265ae0

Please sign in to comment.