git-github-advanced: note the PR-head-checkout CI gotcha - #146
Merged
Conversation
On pull_request, actions/checkout defaults to the synthetic refs/pull/N/merge commit — an ephemeral merge of the head into the base — so HEAD is a merge commit, not the branch tip. Any CI job that inspects commit shape/history misfires on it; e.g. a "no merge commits" check false-positives on a linear branch. Land the gotcha next to the sibling actions/checkout-default trap in the git-github-advanced skill (GitHub Actions gotchas are its scope), framed portably rather than tied to this repo's own checks. Captured from the #141/#142 session, where this cost a CI round-trip. Closes #145 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019mW2ZDXbTgZxwsyrPcUrwy
missingbulb
force-pushed
the
claude/lessons-ci-head-checkout-141
branch
from
July 7, 2026 08:58
74ca9fd to
1d353a3
Compare
missingbulb
marked this pull request as ready for review
July 7, 2026 09:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A lessons-learned capture from the #141/#142 session (squash-merge-history work-scoping).
That change made
squash-merge-historyinspect HEAD's commit shape (mergeBase..HEADfor merge commits). Onpull_requestevents,actions/checkoutdefaults to the syntheticrefs/pull/N/mergecommit as HEAD — an ephemeral merge of the branch into the base — so the check false-positived in CI even though the branch was linear. It cost a full CI round-trip on PR #142 before diagnosis; the fix there wasref: ${{ github.event.pull_request.head.sha || github.sha }}inchecks-ci.yml, with a co-located comment.Routing (corrected)
The portable lesson is a GitHub Actions gotcha, so per
growth/item-routing.mdit belongs in the practice group's git/GitHub owner — thegit-github-advancedskill, whose scope explicitly includes "GitHub Actions gotchas." It lands right next to the siblingactions/checkout-default trap ("A CI job that reads submodule files must fetch submodules in its checkout"), framed portably (any commit-shape/history job, any repo) rather than tied to this repo's own checks.(An earlier revision of this PR wrongly put it in
checks/README.md, which is operational doc, not a lesson owner. Reverted.)Why prose, not a check
Mechanism triage lands on rung-5: a check would need to detect that a CI job "inspects commit shape," which has no reliable static signature — fragile and disproportionate. The actionable knowledge is platform behavior (
actions/checkout's default), which prose carries.Closes #145
🤖 Generated with Claude Code