From 3348ff77a34d4574cbd671709b8de1e88688a7e1 Mon Sep 17 00:00:00 2001 From: hc-github-team-consul-core Date: Tue, 9 May 2023 15:01:50 -0400 Subject: [PATCH] backport of commit 061804f941a2b79126c53fdfc530f70b9ddde581 (#17274) Co-authored-by: freddygv --- .github/workflows/backport-assistant.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/backport-assistant.yml b/.github/workflows/backport-assistant.yml index d8f06483c67b..88a7f1da1a25 100644 --- a/.github/workflows/backport-assistant.yml +++ b/.github/workflows/backport-assistant.yml @@ -52,3 +52,16 @@ jobs: BACKPORT_LABEL_REGEXP: "backport/(?P\\d+\\.\\d+)" BACKPORT_TARGET_TEMPLATE: "release/{{.target}}.x" GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }} + handle-failure: + needs: + - backport + if: always() && needs.backport.result == 'failure' + runs-on: ubuntu-latest + steps: + - name: Comment on PR + run: | + github_message="Backport failed @${{ github.event.sender.login }}. Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + curl -s -H "Authorization: token ${{ secrets.PR_COMMENT_TOKEN }}" \ + -X POST \ + -d "{ \"body\": \"${github_message}\"}" \ + "https://api.github.com/repos/${GITHUB_REPOSITORY}/pull/${{ github.event.pull_request.number }}/comments" \ No newline at end of file