ci: remove main branch protection rules (#5125)

This commit is contained in:
Alex Yang
2025-10-06 11:12:27 -07:00
committed by GitHub
parent fc32113a00
commit 7aabcbab40
2 changed files with 0 additions and 54 deletions

View File

@@ -1,36 +0,0 @@
name: Branch Rules
on:
pull_request:
branches:
- main
- canary
- 'v*-staging'
jobs:
check-branch:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: Filter changed files
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
base: ${{ github.base_ref }}
filters: |
# 'src' filter matches any file NOT in the docs/ directory
src:
- '!docs/**'
# 'docs' filter matches any file in the docs/ directory
docs:
- 'docs/**'
- name: Enforce code change PRs target canary or staging
if: steps.filter.outputs.src == 'true' && github.base_ref != 'canary' && !startsWith(github.base_ref, 'v')
run: |
echo "Error: Pull requests with code changes must target 'canary' or a versioned staging branch (e.g., 'v1.2.3-staging')."
exit 1

View File

@@ -1,18 +0,0 @@
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