From 4cc571e8e055090260efb1127b1ff500d8898fbf Mon Sep 17 00:00:00 2001 From: David Sibley Date: Mon, 24 Jul 2023 12:10:28 +0100 Subject: [PATCH 1/2] Added slack failure notifications to apply steps --- .../terraform-member-environment.yml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/terraform-member-environment.yml b/.github/workflows/terraform-member-environment.yml index c7db9d79b..86c1837c5 100644 --- a/.github/workflows/terraform-member-environment.yml +++ b/.github/workflows/terraform-member-environment.yml @@ -185,6 +185,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: | @@ -261,6 +271,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: | From 6d4e867c09711918eb1c8a93ddca4e0c1ac06c5c Mon Sep 17 00:00:00 2001 From: David Sibley Date: Mon, 24 Jul 2023 12:49:39 +0100 Subject: [PATCH 2/2] pruned failure messages to just preprod/prod apply runs --- .github/workflows/terraform-member-environment.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/terraform-member-environment.yml b/.github/workflows/terraform-member-environment.yml index 86c1837c5..b553df4db 100644 --- a/.github/workflows/terraform-member-environment.yml +++ b/.github/workflows/terraform-member-environment.yml @@ -185,16 +185,6 @@ 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: |