diff --git a/.github/workflows/pr-target-check.yml b/.github/workflows/pr-target-check.yml index 7dde21a..02d4b1e 100644 --- a/.github/workflows/pr-target-check.yml +++ b/.github/workflows/pr-target-check.yml @@ -8,15 +8,15 @@ jobs: check-source-branch: runs-on: ubuntu-latest steps: - - name: Only allow PRs from dev to production - if: github.head_ref != 'dev' + - name: Only allow PRs from dev or release branches to production + if: github.head_ref != 'dev' && !startsWith(github.head_ref, 'release/') run: | - echo "::error::PRs targeting 'production' are only allowed from the 'dev' branch." + echo "::error::PRs targeting 'production' are only allowed from 'dev' or 'release/*' branches." echo "Please target 'dev' instead, or merge your branch into 'dev' first." echo "" echo " Source: ${{ github.head_ref }}" echo " Target: ${{ github.base_ref }}" exit 1 - name: PR source branch is valid - if: github.head_ref == 'dev' - run: echo "PR from 'dev' to 'production' — allowed." + if: github.head_ref == 'dev' || startsWith(github.head_ref, 'release/') + run: echo "PR from '${{ github.head_ref }}' to 'production' — allowed."