Skip to content

fix(docs): update tilted world event #148

fix(docs): update tilted world event

fix(docs): update tilted world event #148

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:
- name: Checkout repository
uses: actions/checkout@v2
- id: "master_branch"
if: github.head_ref == 'master'
run: gh pr close $PR_NUMBER --comment "Please do not open pull requests from the `master` branch, create a new branch instead. See [here](https://server.castcrafter.de/write-documentation.html#new-branch) for more information."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
- id: "org_account"
if: github.event.pull_request.head.repo.owner.type != 'User' && steps.master_branch.outcome == 'skipped'
run: gh pr close ${{ github.event.pull_request.number }} --comment "Please do not open pull requests from non-user accounts like organizations. Create a fork on a user account instead."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}