mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 06:25:15 +01:00
Close PRs opened from orgs or bot accounts (#10281)
Expands the existing close_invalid_prs workflow to also close prs that were opened from repositories not owned by user accounts. This is required as such PRs cannot be edited by maintainers. The implementation re-uses the existing job instead of creating a new job to limit the amount of checks to the bare minimum.
This commit is contained in:
parent
681bbff110
commit
850b736e14
1 changed files with 14 additions and 1 deletions
15
.github/workflows/close_invalid_prs.yml
vendored
15
.github/workflows/close_invalid_prs.yml
vendored
|
@ -6,9 +6,22 @@ on:
|
|||
|
||||
jobs:
|
||||
run:
|
||||
if: ${{ github.repository != github.event.pull_request.head.repo.full_name && github.head_ref == 'master' }}
|
||||
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 organizations. Create a fork on a user account instead."
|
||||
|
|
Loading…
Reference in a new issue