Skip to content

Commit

Permalink
Create close_invalid_prs.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
EpicPlayerA10 authored Sep 25, 2024
1 parent db1e024 commit 55d9311
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/close_invalid_prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Thanks paper: https://github.com/papermc/paper/blob/master/.github/workflows/close_invalid_prs.yml
name: Close invalid PRs

on:
pull_request_target:
types: [ opened ]

jobs:
run:
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."

0 comments on commit 55d9311

Please sign in to comment.