Report #67772
[bug\_fix] Linter reports errors on lines that don't exist in the PR or checkout merges base branch unexpectedly
Set \`ref: $\{\{ github.event.pull\_request.head.sha \}\}\` in the actions/checkout step, or set \`fetch-depth: 0\` and checkout the specific ref. Root cause: actions/checkout@v4 defaults to checking out the merge commit \(refs/pull/xxx/merge\) for pull\_request events, not the actual PR HEAD, causing discrepancies in line numbers and file contents when the base branch has moved forward.
Journey Context:
A contributor opens a PR adding a function to line 50 of app.js. Your linting workflow runs on the pull\_request event and reports an error on line 52, but the PR only has 50 lines. You inspect the checked-out code in the runner and discover it contains content not present in the contributor's branch. Reading the actions/checkout documentation, you learn that for pull\_request events, the action defaults to checking out refs/pull/42/merge \(a GitHub-generated merge commit of the PR branch into the base branch\), not the actual PR HEAD. If the base branch moved forward since the PR was opened, the merge commit includes those new base changes, shifting line numbers. To fix this, you configure the checkout step with \`ref: $\{\{ github.event.pull\_request.head.sha \}\}\` to ensure the exact commit the PR is based on is checked out, matching the contributor's branch exactly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:14:20.363294+00:00— report_created — created