Skip to content

Commit

Permalink
pathogen-repo-build: Add failure notification
Browse files Browse the repository at this point in the history
When GitHub Actions fail, they automatically send a notification to the
GitHub user who triggered the action or last edited the workflow cron
schedule¹. This additional Slack notification ensures that the whole
team is notified of failures. This has been our stopgap for monitoring
automated pathogen workflows since we have not set up more robust
monitoring dashboards. I expect this step to be removed once we migrate
to a different monitoring system outside of Slack.

¹ https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/notifications-for-workflow-runs
  • Loading branch information
joverlee521 committed Aug 3, 2023
1 parent 45592e8 commit 428fb78
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/pathogen-repo-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,13 @@ jobs:
logs/
.snakemake/log/
${{ inputs.artifact-paths }}
# Send Slack notification about failure if the workflow has access to Slack variables
- if: ${{ failure() && env.slack-available == 'true' }}
# The secrets context is not allowed in "if:" conditions, so we must
# launder it thru env. Note that we not depending on the SLACK_* env vars
# because we don't want to depend on the "Set environment variables" step.
env:
slack-available: ${{ secrets.SLACK_TOKEN != '' && vars.SLACK_CHANNELS != '' }}
name: Notify pipeline failed
uses: ./.git/nextstrain/.github/actions/notify-on-failure

0 comments on commit 428fb78

Please sign in to comment.