Skip to content

Commit

Permalink
Notify slack of test failures on main (wpengine#9)
Browse files Browse the repository at this point in the history
* Break the build

* Notify slack on failure

* Update notification channel name

* Use channel_id to avoid rate limit issue

* Make sure job can be cancelled

* Revert "Break the build"

This reverts commit 595ceb9.

* Only notify on `main` failures
  • Loading branch information
apmatthews authored Dec 14, 2022
1 parent 52fd9bd commit a843a1a
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/e2e-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,19 @@ jobs:
CACHE_CLEAR: true
validate_result:
runs-on: ubuntu-latest
if: ${{ always() }}
if: ${{ !cancelled() }}
needs: run_action
steps:
- name: Validate deploy results
run: |
[ ${{needs.run_action.outputs.status}} = "pass" ] || exit 1
# - name: Notify slack on failure
# if: failure() && github.ref == 'refs/heads/main'
# env:
# SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
# uses: voxmedia/github-action-slack-notify-build@v1
# with:
# channel: status-github-action
# status: FAILED
# color: danger
- name: Notify slack on failure
if: failure() && github.ref == 'refs/heads/main'
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
# Channel: status-site-deploy
channel_id: C04ELD8NMT4
status: FAILED
color: danger

0 comments on commit a843a1a

Please sign in to comment.