From e2ade4fffabfe01107173a1f98e9edb3bd4b50b5 Mon Sep 17 00:00:00 2001 From: hc-github-team-nomad-core <82989552+hc-github-team-nomad-core@users.noreply.github.com> Date: Thu, 10 Nov 2022 16:12:58 -0500 Subject: [PATCH] backport of commit 267217c13aa74ddfca3abca4d5a06dbec6bdac96 (#15208) This pull request was automerged via backport-assistant --- .github/workflows/backport.yml | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 44ccc79441a..a6e0121ca40 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -27,3 +27,43 @@ jobs: BACKPORT_LABEL_REGEXP: "backport/(?P\\d+\\.\\d+\\.[+\\w]+)" BACKPORT_TARGET_TEMPLATE: "release/{{.target}}" GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }} + handle-failure: + needs: + - backport + if: always() && needs.backport.result == 'failure' + runs-on: ubuntu-latest + steps: + - name: Send slack notification on failure + uses: slackapi/slack-github-action@v1.23.0 + with: + payload: | + { + "text": ":x::arrow_right_hook::nomad-sob: Backport run *FAILED*", + "attachments": [ + { + "color": "#C41E3A", + "blocks": [ + { + "type": "section", + "fields": [ + { + "type": "mrkdwn", + "text": "*Pull Request:*\n<${{ github.event.pull_request.html_url}}|${{ github.repository }}#${{ github.event.pull_request.number}}>" + }, + { + "type": "mrkdwn", + "text": "*From:*\n@${{ github.event.sender.login }}" + }, + { + "type": "mrkdwn", + "text": "*Run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_id }}>" + } + ] + } + ] + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.BACKPORT_ASSISTANT_FAILURE_SLACK }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK