From 4293c27c3e924355194e7da9bb41f2941c58806a Mon Sep 17 00:00:00 2001 From: theEvilReaper Date: Fri, 29 Mar 2024 20:13:50 +0100 Subject: [PATCH] Add workflow to close pull request which targets the master branch directly --- .github/workflows/close_invalid_prs.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/close_invalid_prs.yml diff --git a/.github/workflows/close_invalid_prs.yml b/.github/workflows/close_invalid_prs.yml new file mode 100644 index 00000000..9064b676 --- /dev/null +++ b/.github/workflows/close_invalid_prs.yml @@ -0,0 +1,18 @@ +# 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' }} + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + id: "master_branch" + if: github.head_ref == 'master' + with: + comment: | + Hi there! :wave: This PR is targeting the `master` branch, which is not allowed. Please target the `develop` branch instead. Thanks! \ No newline at end of file