Skip to content

build(deps): bump actions/cache from 4 to 5 #36

build(deps): bump actions/cache from 4 to 5

build(deps): bump actions/cache from 4 to 5 #36

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