Skip to content

Fix the branch names in restrict-branch-merge.yml #2

Fix the branch names in restrict-branch-merge.yml

Fix the branch names in restrict-branch-merge.yml #2

name: "Enforce Branch Merge Rules"
on:
pull_request:
branches:
- main
- release
jobs:
check-branch:
runs-on: ubuntu-latest
steps:
- name: Enforce develop -> release
if: github.ref == 'refs/heads/release' && github.head_ref != 'develop'
run: |
echo "Only the develop branch can be merged into the release branch."
exit 1
- name: Enforce release/hotfix -> main
if: github.ref == 'refs/heads/main' && github.head_ref != 'release' && github.head_ref != 'hotfix'
run: |
echo "Only the release or hotfix branch can be merged into the main branch."
exit 1