auto close pr if check fails

This commit is contained in:
Noah Masur 2023-09-30 09:35:37 -04:00
parent c9aa20c703
commit d84be966fc

View File

@ -33,6 +33,20 @@ jobs:
- name: Check the Flake - name: Check the Flake
run: nix flake check run: nix flake check
- name: Enable Pull Request Automerge - name: Enable Pull Request Automerge
run: gh pr merge --rebase --auto ${{ steps.update.outputs.pull-request-number }} if: success()
run: |
gh pr merge \
--rebase \
--auto \
${{ steps.update.outputs.pull-request-number }}
env:
GH_TOKEN: ${{ github.token }}
- name: Close Pull Request If Failed
if: failure()
run: |
gh pr close \
--comment "Auto-closing pull request" \
--delete-branch \
${{ steps.update.outputs.pull-request-number }}
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}