Skip to content

Fix the squash-commit idempotency check to resolve in real action runs#43

Open
Phlogistique wants to merge 1 commit into
mainfrom
claude/idempotency-check-pr-stack-awofvk
Open

Fix the squash-commit idempotency check to resolve in real action runs#43
Phlogistique wants to merge 1 commit into
mainfrom
claude/idempotency-check-pr-stack-awofvk

Conversation

@Phlogistique

Copy link
Copy Markdown
Collaborator

has_squash_commit compared the target with a bare branch name like "main".
actions/checkout leaves a detached HEAD and creates no local branches, so
"main" does not resolve and git exits 128, which the if silently reads as
"not up-to-date". The skip branch was therefore dead in CI and only worked
in tests, where the test repos have every branch locally.

This matters on the resume path: the push that finishes conflict resolution
fires a synchronize event while the conflict label is still on. If that
second run loses the race against the label removal, the broken check let it
re-run the whole merge and push a second redundant synthetic merge commit.

Compare against origin/$TARGET_BRANCH instead. With fetch-depth: 0 the
remote-tracking ref always exists, so the check works in production while
staying correct in tests.

@Phlogistique Phlogistique force-pushed the claude/idempotency-check-pr-stack-awofvk branch from 4b8fab3 to c4a89bd Compare June 9, 2026 21:12
has_squash_commit compared the target with a bare branch name like "main".
actions/checkout leaves a detached HEAD and creates no local branches, so
"main" does not resolve and git exits 128, which the if silently reads as
"not up-to-date". The skip branch was therefore dead in CI and only worked
in tests, where the test repos have every branch locally.

This matters on the resume path: the push that finishes conflict resolution
fires a synchronize event while the conflict label is still on. If that
second run loses the race against the label removal, the broken check let it
re-run the whole merge and push a second redundant synthetic merge commit.

Compare against origin/$TARGET_BRANCH instead. With fetch-depth: 0 the
remote-tracking ref always exists, so the check works in production while
staying correct in tests.
@Phlogistique Phlogistique force-pushed the claude/idempotency-check-pr-stack-awofvk branch from c4a89bd to 9681264 Compare June 9, 2026 21:16
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.

2 participants