delete branch if bump fails
This commit is contained in:
parent
a679dc9593
commit
5abf26b289
1 changed files with 8 additions and 3 deletions
|
|
@ -24,9 +24,10 @@ jobs:
|
||||||
env:
|
env:
|
||||||
PREEM_PUSH_TOKEN: ${{ secrets.PREEM_PUSH_TOKEN }}
|
PREEM_PUSH_TOKEN: ${{ secrets.PREEM_PUSH_TOKEN }}
|
||||||
|
|
||||||
# nightly-flake-update.yaml opens PRs from flake-update-* branches; if
|
# flake-update.yaml opens PRs from flake-update-* branches; if the
|
||||||
# the build fails on one of those, close it rather than leaving a
|
# build fails on one of those, close it and delete the branch rather
|
||||||
# broken auto-generated PR around. Scoped to that branch prefix so a
|
# than leaving a broken auto-generated PR around (and so a same-day
|
||||||
|
# rerun can push the branch again). Scoped to that branch prefix so a
|
||||||
# failing build on a human-authored PR is never auto-closed.
|
# failing build on a human-authored PR is never auto-closed.
|
||||||
close-on-failure:
|
close-on-failure:
|
||||||
needs: build
|
needs: build
|
||||||
|
|
@ -39,5 +40,9 @@ jobs:
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"state": "closed"}' \
|
-d '{"state": "closed"}' \
|
||||||
"https://forge.darkest.space/api/v1/repos/mara/nixos-configs/pulls/${{ github.event.pull_request.number }}"
|
"https://forge.darkest.space/api/v1/repos/mara/nixos-configs/pulls/${{ github.event.pull_request.number }}"
|
||||||
|
curl -sf -X DELETE \
|
||||||
|
-H "Authorization: token ${PR_BOT_TOKEN}" \
|
||||||
|
"https://forge.darkest.space/api/v1/repos/mara/nixos-configs/branches/${HEAD_REF}"
|
||||||
env:
|
env:
|
||||||
PR_BOT_TOKEN: ${{ secrets.PR_BOT_TOKEN }}
|
PR_BOT_TOKEN: ${{ secrets.PR_BOT_TOKEN }}
|
||||||
|
HEAD_REF: ${{ github.head_ref }}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue