diff --git a/.github/workflows/close-prs.yml b/.github/workflows/close-prs.yml new file mode 100644 index 00000000..f2b9dfc8 --- /dev/null +++ b/.github/workflows/close-prs.yml @@ -0,0 +1,21 @@ +# GitHub has no switch to disable pull requests, so this closes them on arrival. +# Uses pull_request_target (base-repo context, no PR code checked out) so it can +# comment and close on PRs from forks. +name: close-prs +on: + pull_request_target: + types: [opened, reopened] +permissions: + pull-requests: write +jobs: + close: + runs-on: ubuntu-latest + steps: + - run: | + gh pr comment "$PR" --repo "$REPO" --body \ + "Thanks for the interest! benilla is a solo project and isn't taking pull requests for now — please bring bug reports and ideas to the Discord instead: https://discord.gg/wJSJx467G4" + gh pr close "$PR" --repo "$REPO" + env: + GH_TOKEN: ${{ github.token }} + PR: ${{ github.event.pull_request.number }} + REPO: ${{ github.repository }}