ci(pr-flow): add PR base guard — block stacked PRs#451
Conversation
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 3 minutes and 59 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA new GitHub Actions workflow is introduced to validate that pull requests target the repository's default branch, rejecting PRs with incorrect base branch selection before proceeding. ChangesPR Base Guard Workflow
Estimated Code Review Effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions guard to prevent “stacked PR” workflows by enforcing that every pull request targets the repository’s default branch, avoiding downstream base desync under squash + auto-merge.
Changes:
- Introduces a new
pull_requestworkflow that fails whenpull_request.base.refis notrepository.default_branch. - Emits a clear error annotation explaining the policy and how to resolve it (rebase/retarget onto the default branch).
97387a8 to
2a2d016
Compare
2a2d016 to
fd19776
Compare
Why
Sister project lazie had stacked PRs (#108/#109/#110) desync under squash + auto-merge today. Adding the same guard repo-wide.
Topology-aware auto-merge wouldn't fix it: squash merge produces new SHAs that downstream PR base refs don't reflect, so the chain breaks even with correct ordering.
What
.github/workflows/assert-base-is-default-branch.yml— any PR whosebase.ref != repository.default_branchfails. Branch from main, merge serially.Test plan
main→ check passes🤖 Generated with Claude Code
Summary by CodeRabbit