mirror of https://github.com/status-im/consul.git
Post a PR comment if the backport runner fails (#17197)
This commit is contained in:
parent
7c3e9cd862
commit
0f23def80c
|
@ -28,3 +28,16 @@ jobs:
|
||||||
BACKPORT_LABEL_REGEXP: "backport/(?P<target>\\d+\\.\\d+)"
|
BACKPORT_LABEL_REGEXP: "backport/(?P<target>\\d+\\.\\d+)"
|
||||||
BACKPORT_TARGET_TEMPLATE: "release/{{.target}}.x"
|
BACKPORT_TARGET_TEMPLATE: "release/{{.target}}.x"
|
||||||
GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
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"
|
Loading…
Reference in New Issue