Skip to content

ci(pr-checks): diff against the merge commit's first parent, not the frozen PR base - #840

Merged
jing2uo merged 1 commit into
mainfrom
fix/pr-checks-diff-base
Oct 25, 2026
Merged

jing2uo merged 1 commit into
mainfrom
fix/pr-checks-diff-base

Conversation

@jing2uo

@jing2uo jing2uo commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

Problem

pull_request.base.sha is the main tip at the PR's last push, but actions/checkout builds refs/pull/N/merge onto the current main. When main moves while the PR is open (the twice-daily pin refresh makes this common), base.sha..HEAD also contains everything main merged since.

Example: #836 added only com.autonomylogic.openplceditor, but build-changed built 19 apps and downloaded every payload for the apply_extra check, because #837 refreshed 18 pins between the PR's push and its CI run.

Fix

Use git rev-parse HEAD^1 (the merge commit's first parent, i.e. the main tip this run merged onto) as the diff base in all three places:

  • build-changed: changed apps + apply_extra scope
  • automation tripwire: was over-gating, which was the safe direction; now it judges the actual merge result, no looser than before
  • dead-link check

Verified

Simulated the #836 merge ref locally (b2226ae + 817a3d4) and ran changed-apps.sh: old base → 19 apps, new base → com.autonomylogic.openplceditor only. actionlint: clean apart from the existing ubuntu-26.04 label notice.

…frozen PR base

pull_request.base.sha stays at the main tip of the PR's last push, while
checkout builds refs/pull/N/merge onto the current main. Once main moves
(a pin refresh, another app), base.sha..HEAD pulls in every app main
touched since: #836 added one app but built and apply_extra-checked 19,
because #837 had refreshed 18 pins in between. HEAD^1 is the main tip
this run actually merged onto, so the diff is exactly the PR's effect.

Applies to build-changed, the automation tripwire and the dead-link check.
@jing2uo
jing2uo merged commit 2a792fa into main Oct 25, 2026
@jing2uo
jing2uo deleted the fix/pr-checks-diff-base branch October 25, 2026 01:23
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.

1 participant