chore(docs): reduce Ai sloppyness #3
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: Check Source Branch | |
| on: | |
| pull_request: | |
| branches: | |
| - prod | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - edited | |
| jobs: | |
| check-source-branch: | |
| name: check-source-branch | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check source branch | |
| run: | | |
| HEAD_BRANCH="${{ github.head_ref }}" | |
| BASE_BRANCH="${{ github.base_ref }}" | |
| echo "PR: ${HEAD_BRANCH} → ${BASE_BRANCH}" | |
| if [ "$BASE_BRANCH" = "prod" ] && [ "$HEAD_BRANCH" != "develop" ]; then | |
| echo "::error::Merging to 'prod' is only allowed from the 'develop' branch." | |
| echo "::error::Source branch '${HEAD_BRANCH}' is not permitted." | |
| exit 1 | |
| fi | |
| echo "✅ Source branch '${HEAD_BRANCH}' is allowed to merge into '${BASE_BRANCH}'." |