diff --git a/.github/workflows/close-prs.yml b/.github/workflows/close-prs.yml new file mode 100644 index 0000000..85796f0 --- /dev/null +++ b/.github/workflows/close-prs.yml @@ -0,0 +1,19 @@ +name: Auto-close PRs + +on: + pull_request: + types: [opened] + +jobs: + close-pr: + runs-on: ubuntu-latest + steps: + - name: Install GitHub CLI + run: sudo apt-get install gh -y + + - name: Close PR and delete branch + run: | + gh pr close "$PR_URL" --delete-branch + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_URL: ${{ github.event.pull_request.html_url }}