Skip to content

ci: PR base-freshness guard against stale-base squash-merge (#516) - #528

Merged
samxu01 merged 1 commit into
mainfrom
ci/stale-base-merge-guard
Jun 29, 2026
Merged

ci: PR base-freshness guard against stale-base squash-merge (#516)#528
samxu01 merged 1 commit into
mainfrom
ci/stale-base-merge-guard

Conversation

@samxu01

@samxu01 samxu01 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Closes #516.

Adds a lightweight GitHub Action (pr-base-freshness.yml) that fails a PR whose merge-base is more than MAX_BEHIND (40) commits behind origin/main, forcing a rebase before merge — codifying the stale-base squash-merge footgun (PR #503 silently reverted #506/#507).

Checks out the PR head sha (not the default merge ref, whose merge-base with main is always main’s tip → the guard would be a silent no-op), fetches origin/main explicitly, then git rev-list --count merge-base..origin/main. Pure git, no external deps.

🤖 Generated with Claude Code

Fails a pull_request against main when its merge-base has drifted more than MAX_BEHIND (40) commits behind origin/main, forcing a rebase before merge. Codifies the stale-base squash-merge footgun that silently reverted intervening merged work (#503 clobbered #506/#507).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_019vuFLFHnmJKmMxosHSWA4P
@samxu01
samxu01 merged commit 2aefa6a into main Jun 29, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent PRs branch off stale main → squash-merge silently reverts intervening work

1 participant