Skip to content

Staging

Staging #1

Workflow file for this run

name: Protect main from unauthorized merges
on:
pull_request:
branches:
- main
jobs:
restrict-main-source:
runs-on: ubuntu-latest
steps:
- name: Validate PR source branch
run: |
SRC="${{ github.head_ref }}"
echo "PR opened from: $SRC"
# Allowed sources
if [[ "$SRC" == "staging" ]] || [[ "$SRC" == hotfix/* ]]; then
echo "✔ Allowed branch for merging into main."
exit 0
fi
echo "❌ PRs into main must come from 'staging' or 'hotfix/*'."
exit 1