From d84be966fca7d332671a064c3f559f59e5c918c9 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sat, 30 Sep 2023 09:35:37 -0400 Subject: [PATCH] auto close pr if check fails --- .github/workflows/update.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index b41f0a0..54c8095 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -33,6 +33,20 @@ jobs: - name: Check the Flake run: nix flake check - 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: GH_TOKEN: ${{ github.token }}