You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a repo whose ruleset stales approvals when a PR's merge base changes, an atomic stack merge can never succeed for stacks of ≥2 PRs: the merge itself changes the upper PRs' merge bases as it lands the lower ones, invalidating their (fresh) approvals mid-operation, and the all-or-nothing semantics then roll everything back.
Repro
Repo ruleset: require approvals + "approvals must postdate the last merge-base change" behavior (approvals are reported stale when the merge base moves), plus CODEOWNERS.
Stack of 2+ PRs, all layers freshly approved on their current heads, all checks green, nothing moving the base branch.
Run gh stack merge <stack> --yes --squash (or the UI Merge stack).
Result
✗ merge failed: Repository rule violations found
Waiting on 1 reapproval from someone other than the last pusher. N reviews are stale because they were submitted before the merge base changed.
Stack merges are atomic, so nothing was merged.
Verified the approvals were the last event before the merge attempt (submitted on the current head SHAs, after the last restack and after the base branch last moved) — so the only merge-base change that can be staleing them is the one performed internally by the atomic merge (layer N landing changes layer N+1's base).
Expected
The docs say rules for stacked PRs are "enforced against the stack's base branch for every pull request in the stack" — I'd expect the atomic merge's own internal retargets not to count as approval-invalidating merge-base changes (the approved diffs are unchanged). Otherwise atomic stack merges are unusable in any org with this rule, which is a common strict-review configuration.
Environment
gh 2.92.0, gh-stack (current as of 2026-09-01), GHEC org repo with rulesets + CODEOWNERS.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Summary
In a repo whose ruleset stales approvals when a PR's merge base changes, an atomic stack merge can never succeed for stacks of ≥2 PRs: the merge itself changes the upper PRs' merge bases as it lands the lower ones, invalidating their (fresh) approvals mid-operation, and the all-or-nothing semantics then roll everything back.
Repro
gh stack merge <stack> --yes --squash(or the UI Merge stack).Result
Verified the approvals were the last event before the merge attempt (submitted on the current head SHAs, after the last restack and after the base branch last moved) — so the only merge-base change that can be staleing them is the one performed internally by the atomic merge (layer N landing changes layer N+1's base).
Expected
The docs say rules for stacked PRs are "enforced against the stack's base branch for every pull request in the stack" — I'd expect the atomic merge's own internal retargets not to count as approval-invalidating merge-base changes (the approved diffs are unchanged). Otherwise atomic stack merges are unusable in any org with this rule, which is a common strict-review configuration.
Environment
gh 2.92.0, gh-stack (current as of 2026-09-01), GHEC org repo with rulesets + CODEOWNERS.
All reactions