Skip to content

git-github-advanced: note the PR-head-checkout CI gotcha - #146

Merged
missingbulb merged 1 commit into
mainfrom
claude/lessons-ci-head-checkout-141
Jul 7, 2026
Merged

git-github-advanced: note the PR-head-checkout CI gotcha#146
missingbulb merged 1 commit into
mainfrom
claude/lessons-ci-head-checkout-141

Conversation

@missingbulb

@missingbulb missingbulb commented Jul 7, 2026

Copy link
Copy Markdown
Owner

What

A lessons-learned capture from the #141/#142 session (squash-merge-history work-scoping).

That change made squash-merge-history inspect HEAD's commit shape (mergeBase..HEAD for merge commits). On pull_request events, actions/checkout defaults to the synthetic refs/pull/N/merge commit 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 was ref: ${{ github.event.pull_request.head.sha || github.sha }} in checks-ci.yml, with a co-located comment.

Routing (corrected)

The portable lesson is a GitHub Actions gotcha, so per growth/item-routing.md it belongs in the practice group's git/GitHub owner — the git-github-advanced skill, whose scope explicitly includes "GitHub Actions gotchas." It lands right next to the sibling actions/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

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
missingbulb force-pushed the claude/lessons-ci-head-checkout-141 branch from 74ca9fd to 1d353a3 Compare July 7, 2026 08:58
@missingbulb missingbulb changed the title checks/README: note the PR-head-checkout caveat for CI git-github-advanced: note the PR-head-checkout CI gotcha Jul 7, 2026
@missingbulb
missingbulb marked this pull request as ready for review July 7, 2026 09:02
@missingbulb
missingbulb merged commit 8c4c47a into main Jul 7, 2026
1 check passed
@missingbulb
missingbulb deleted the claude/lessons-ci-head-checkout-141 branch July 7, 2026 09:03
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.

CI-wiring guidance omits the PR-head-checkout caveat for HEAD-shape checks

2 participants