From 4f16caa5ff57a4f64d901a23f0cc4479b3733ee2 Mon Sep 17 00:00:00 2001 From: Andrew Dryga Date: Tue, 11 Jul 2023 14:17:47 -0600 Subject: [PATCH] Add slack notification for failed deployments --- .github/workflows/cd.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8fb26c665..ff7f3903a 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -87,3 +87,16 @@ jobs: with: run: ${{ steps.apply-run.outputs.run_id }} comment: "Apply Run from GitHub Actions CI ${{ github.sha }}" + - name: Report Status + if: failure() + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_USERNAME: "GitHub Actions" + SLACK_COLOR: "#ff0000" + MSG_MINIMAL: "ref,actions url" + SLACK_TITLE: "Deployment Failed" + SLACK_MESSAGE: "Automatic deployment to ${{ env.TF_WORKSPACE }} failed" + with: + status: ${{ job.status }} + notify_when: "failure"