Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/main-branch-guard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Main Branch Source Guard

on:
pull_request:
branches: [main]
types: [opened, reopened, synchronize, edited]
Comment on lines +4 to +7

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
guard:
name: Guard main branch source
runs-on: ubuntu-latest
steps:
- name: Verify pull request source branch
env:
HEAD_REF: ${{ github.head_ref }}
run: |
if [[ "${HEAD_REF}" == "next" || "${HEAD_REF}" == hotfix-* ]]; then
echo "Head branch '${HEAD_REF}' is allowed to target main."
exit 0
fi
echo "::error::Pull requests into main must come from 'next' or a 'hotfix-*' branch (got '${HEAD_REF}'). See ADR-0008 (z-shell/.github) for the branching model."
exit 1
3 changes: 2 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"local>z-shell/.github:renovate-config",
":dependencyDashboardApproval",
":disableVulnerabilityAlerts"
]
],
"baseBranches": ["next"]
}