Restrict Branch Merge and Automatically Add PR labels to Pull Requests #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Enforce Release or Hotfix Branch Merge" | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
check-branch: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check if PR is from the release or hotfix branch | |
if: github.head_ref != 'release' && github.head_ref != 'hotfix' | |
run: | | |
echo "Only the release or hotfix branch can be merged into main." | |
exit 1 |