build(deps): bump actions/cache from 4 to 5 #36
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 if PR source branch is allowed for main branch | |
| on: | |
| pull_request: | |
| types: [ opened, reopened, synchronize, edited, ready_for_review ] | |
| branches: | |
| - main | |
| jobs: | |
| enforce: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| steps: | |
| - name: Check PR source branch | |
| env: | |
| HEAD_REF: ${{ github.head_ref }} | |
| run: | | |
| echo "Head branch: $HEAD_REF" | |
| if [[ "$HEAD_REF" == "development" || "$HEAD_REF" =~ ^release/ || "$HEAD_REF" =~ ^hotfix/ ]]; then | |
| echo "✔ Allowed source branch." | |
| exit 0 | |
| else | |
| echo "❌ Disallowed source branch: $HEAD_REF" | |
| echo "Only 'development', 'release/*', or 'hotfix/*' may open PRs into 'main'." | |
| exit 1 | |
| fi |