From e29ae6f4f0f9cc9177967a2c294c75484382da2a Mon Sep 17 00:00:00 2001 From: proplayer919 <95329795+proplayer919@users.noreply.github.com> Date: Sat, 23 May 2026 22:47:10 +1000 Subject: [PATCH] Create invalid-prs.yml --- .github/workflows/invalid-prs.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/invalid-prs.yml diff --git a/.github/workflows/invalid-prs.yml b/.github/workflows/invalid-prs.yml new file mode 100644 index 0000000..e4ba158 --- /dev/null +++ b/.github/workflows/invalid-prs.yml @@ -0,0 +1,28 @@ +name: Close invalid PRs + +on: + pull_request_target: + types: [ opened ] + +jobs: + run: + name: Close invalid PRs + if: | + github.repository != github.event.pull_request.head.repo.full_name && + ( + github.head_ref == 'master' || + github.event.pull_request.head.repo.owner.type != 'User' + ) + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + id: "master_branch" + if: github.head_ref == 'master' + with: + comment: "Please do not open pull requests from the `master` branch, create a new branch instead." + + - uses: superbrothers/close-pull-request@v3 + id: "org_account" + if: github.event.pull_request.head.repo.owner.type != 'User' && steps.master_branch.outcome == 'skipped' + with: + comment: "Please do not open pull requests from non-user accounts like organisations. Create a fork on a user account instead."