Skip to content

fix: prevent Codex tab crash #2370

fix: prevent Codex tab crash

fix: prevent Codex tab crash #2370

# Fails a required status check if a pull request from one `repo-sync/*`
# branch targets another `repo-sync/*` branch. Combined with branch
# protection on `repo-sync/**` requiring this check, this prevents one sync
# PR from being merged into another sync PR's branch (which would bypass the
# restacking flow and corrupt the sync stack).
#
# PRs from non-`repo-sync/*` branches into `repo-sync/*` branches (e.g. for
# conflict resolution) are intentionally allowed. Direct pushes to
# `repo-sync/*` branches are also unaffected, since only the `pull_request`
# trigger is used here.
name: Sync PR Checks
on:
pull_request:
types: [opened, reopened, edited, synchronize, ready_for_review]
jobs:
check:
name: Verify PR base is the default branch
runs-on: ubuntu-slim
steps:
- name: Fail if merging a repo-sync branch into another repo-sync branch
env:
BASE_REF: ${{ github.base_ref }}
HEAD_REF: ${{ github.head_ref }}
run: |
if [[ "$BASE_REF" == repo-sync/* && "$HEAD_REF" == repo-sync/* ]]; then
echo "::error::repo-sync/* PRs cannot be merged into other repo-sync/* branches."
echo "Wait for repo-sync to retarget this PR to the default branch before merging."
exit 1
fi
echo "Base branch '$BASE_REF' and head branch '$HEAD_REF' are OK."