check_source_branch_is_not_master.yml 415 B

123456789101112131415
  1. name: Check PR source branch
  2. on:
  3. pull_request_target:
  4. types: [opened, synchronize]
  5. jobs:
  6. check-source-branch-is-not-main-or-master:
  7. runs-on: ubuntu-latest
  8. if: contains(fromJSON('["main", "master"]'), github.head_ref)
  9. # or github.event.pull_request.head.ref
  10. steps:
  11. - run: |
  12. echo "Error: Pull requests should not be from your 'main' or 'master' branch. :("
  13. exit 1