Skip to content

Commit

Permalink
Added slack failure notifications to bespoke environment changes (#4624)
Browse files Browse the repository at this point in the history
* Added slack failure notifications to apply steps

* pruned failure messages to just preprod/prod apply runs
  • Loading branch information
dms1981 authored Jul 24, 2023
1 parent 438df4b commit 5e49f40
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/terraform-member-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,16 @@ jobs:
unset workspace
done
- name: Slack failure notification
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0
with:
payload: |
{"blocks":[{"type": "section","text": {"type": "mrkdwn","text": ":no_entry: Failed GitHub Action:"}},{"type": "section","fields":[{"type": "mrkdwn","text": "*Workflow:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }}>"},{"type": "mrkdwn","text": "*Job:*\n${{ github.job }}"},{"type": "mrkdwn","text": "*Repo:*\n${{ github.repository }}"}]}]}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
if: ${{ failure() }}

- name: Mark job skipped
if: ${{ steps.workspace.outputs.skip_plan == 'true' }}
run: |
Expand Down

0 comments on commit 5e49f40

Please sign in to comment.