From 7aabcbab4007ab3ecc56a0798af232a4a69c908f Mon Sep 17 00:00:00 2001 From: Alex Yang Date: Mon, 6 Oct 2025 11:12:27 -0700 Subject: [PATCH] ci: remove main branch protection rules (#5125) --- .github/workflows/branch-rules.yml | 36 ------------------------------ .github/workflows/main-protect.yml | 18 --------------- 2 files changed, 54 deletions(-) delete mode 100644 .github/workflows/branch-rules.yml delete mode 100644 .github/workflows/main-protect.yml diff --git a/.github/workflows/branch-rules.yml b/.github/workflows/branch-rules.yml deleted file mode 100644 index 382635ac..00000000 --- a/.github/workflows/branch-rules.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/main-protect.yml b/.github/workflows/main-protect.yml deleted file mode 100644 index b9d8dc36..00000000 --- a/.github/workflows/main-protect.yml +++ /dev/null @@ -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