ci: enforce dev → main PR flow #1
Workflow file for this run
This file contains hidden or 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: PR Target Check | |
| on: | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| check-source-branch: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Only allow PRs from dev to main | |
| if: github.head_ref != 'dev' | |
| run: | | |
| echo "::error::PRs targeting 'main' are only allowed from the 'dev' branch." | |
| 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 'main' — allowed." |