ci: main branch protection (#4443)

This commit is contained in:
Alex Yang
2025-09-04 15:35:39 -07:00
committed by GitHub
parent d814537e62
commit a4d7ae12f0

18
.github/workflows/main-protect.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: Main Branch Protection
on:
pull_request:
branches:
- main
jobs:
check-branch:
runs-on: ubuntu-latest
steps:
- name: Check branch
run: |
if [[ ${GITHUB_HEAD_REF} != canary ]] && ! [[ ${GITHUB_HEAD_REF} =~ ^v[0-9]+\.[0-9]+\.[0-9]+-staging$ ]];
then
echo "Error: Pull request must come from 'canary' or 'v*.*.*-staging' branch"
exit 1
fi