diff --git a/.github/workflows/check-branch.yml b/.github/workflows/check-branch.yml index d49bf61..92d74c9 100644 --- a/.github/workflows/check-branch.yml +++ b/.github/workflows/check-branch.yml @@ -1,4 +1,4 @@ -name: Prevent PR to Main +name: Prevent Non-Release PRs to Main on: pull_request: @@ -9,7 +9,9 @@ jobs: check-target-branch: runs-on: ubuntu-latest steps: - - name: Fail if PR targets the main branch + - name: Check if the source branch is a release branch run: | - echo "PRs should not be merged into the main branch directly." - exit 1 \ No newline at end of file + if [[ "${{ github.head_ref }}" != release/* ]]; then + echo "Only release branches can be merged into the main branch." + exit 1 + fi \ No newline at end of file