From 808dca5a7c03c23301cfb2f77fb9b1884697f186 Mon Sep 17 00:00:00 2001 From: Sean Mann Date: Fri, 18 Jul 2025 17:00:51 -0700 Subject: [PATCH 1/2] Create close-prs.yml --- .github/workflows/close-prs.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/close-prs.yml diff --git a/.github/workflows/close-prs.yml b/.github/workflows/close-prs.yml new file mode 100644 index 0000000..79b0469 --- /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 with GH CLI + run: | + gh pr close "$PR_URL" --comment "👋 This repository is only for Discussions — pull requests are not accepted here." --delete-branch + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_URL: ${{ github.event.pull_request.html_url }} From d4a90dacf346a57365eb0011d78a68be21ed25a2 Mon Sep 17 00:00:00 2001 From: Sean Mann Date: Fri, 18 Jul 2025 17:03:16 -0700 Subject: [PATCH 2/2] Update close-prs.yml --- .github/workflows/close-prs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/close-prs.yml b/.github/workflows/close-prs.yml index 79b0469..85796f0 100644 --- a/.github/workflows/close-prs.yml +++ b/.github/workflows/close-prs.yml @@ -11,9 +11,9 @@ jobs: - name: Install GitHub CLI run: sudo apt-get install gh -y - - name: Close PR with GH CLI + - name: Close PR and delete branch run: | - gh pr close "$PR_URL" --comment "👋 This repository is only for Discussions — pull requests are not accepted here." --delete-branch + gh pr close "$PR_URL" --delete-branch env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_URL: ${{ github.event.pull_request.html_url }}