diff options
author | Bjarne Koll <[email protected]> | 2024-02-28 15:18:58 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-02-28 15:18:58 +0100 |
commit | 850b736e1442587230bbba241f99eb0cee193cd9 (patch) | |
tree | 53ec946b15ea36d7830063c768faa34dd9fadc1c | |
parent | 681bbff110d9a56152ae898c4dfe1c0356b40e69 (diff) | |
download | Paper-850b736e1442587230bbba241f99eb0cee193cd9.tar.gz Paper-850b736e1442587230bbba241f99eb0cee193cd9.zip |
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.
-rw-r--r-- | .github/workflows/close_invalid_prs.yml | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/.github/workflows/close_invalid_prs.yml b/.github/workflows/close_invalid_prs.yml index 34c2688d7e..ef572c25c8 100644 --- a/.github/workflows/close_invalid_prs.yml +++ b/.github/workflows/close_invalid_prs.yml @@ -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." |