close-master-pr.yml 1.7 KB

123456789101112131415161718192021222324252627
  1. name: Close PRs on master
  2. on:
  3. pull_request_target:
  4. types: [ opened, ready_for_review ]
  5. jobs:
  6. run:
  7. runs-on: ubuntu-latest
  8. if: ${{github.head_ref == 'master' || github.head_ref == 'main' || github.head_ref == 'develop'}}
  9. steps:
  10. - uses: superbrothers/close-pull-request@v3
  11. with:
  12. comment: "Thank you for contributing to the Space Station 14 repository. Unfortunately, it looks like you submitted your pull request from the master branch. We suggest you follow [our git usage documentation](https://docs.spacestation14.com/en/general-development/setup/git-for-the-ss14-developer.html) \n\n You can move your current work from the master branch to another branch by doing `git branch <branch_name` and resetting the master branch."
  13. # If you prefer to just comment on the pr and not close it, uncomment the bellow and comment the above
  14. # - uses: actions/github-script@v7
  15. # with:
  16. # script: |
  17. # github.rest.issues.createComment({
  18. # issue_number: ${{ github.event.number }},
  19. # owner: context.repo.owner,
  20. # repo: context.repo.repo,
  21. # body: "Thank you for contributing to the Space Station 14 repository. Unfortunately, it looks like you submitted your pull request from the master branch. We suggest you follow [our git usage documentation](https://docs.spacestation14.com/en/general-development/setup/git-for-the-ss14-developer.html) \n\n You can move your current work from the master branch to another branch by doing `git branch <branch_name` and resetting the master branch. \n\n This pr won't be automatically closed. However, a maintainer may close it for this reason."
  22. # })