Fix changed-file detection, which was linting nothing - #1356
Merged
Conversation
Every per-file check in this workflow has been passing without looking at a
single file:
fatal: ambiguous argument 'origin/...HEAD': unknown revision or path
::info::Workflow triggered by PR
Changed files: ''
`github.base_ref` is only populated on pull_request events. This workflow
triggers on push (`branches-ignore: [main]`) and has no pull_request trigger,
so base_ref is always empty, the revision becomes the literal `origin/...HEAD`,
and the diff fails. The empty file list then makes Check Spelling, Check
Prose, Check Markdown, Check page meta and Check slurm scripts each skip to a
green "no files to check". Only Test build was doing real work. The
`::info::Workflow triggered by PR` line printed unconditionally, so the log
asserted a trigger that had not happened.
Fall back to the repository default branch when base_ref is empty, and fail
the step outright if that ref cannot be resolved. Silently linting nothing is
worse than a red job, because it reads as a pass.
Verified against #1355, which changes 167 pages: the old command yields an
empty list, the new one yields all 167. The empty case still works too - grep
finding no matches no longer aborts the step under `bash -e`.
Only reachable via push and repository_dispatch; the workflow_dispatch path
supplies `fileList` explicitly and is unaffected.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
Test deployment successful!! (2026-07-29T09:54:55Z) |
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.
Summary
Every per-file check in
checks.ymlhas been passing without looking at a single file. From theDetermine what files to checkjob on #1355:and then, in
Check page meta:Cause.
github.base_refis only populated onpull_requestevents. This workflow triggers onpush(branches-ignore: [main]) and has nopull_requesttrigger at all, sobase_refis always empty. The revision ingit diff --name-only origin/${{ github.base_ref }}...HEADbecomes the literal
origin/...HEAD, the diff fails, andchanged_filescomes back empty. Each dependent job then hits itsif: ${{! needs.get.outputs.filelist}}branch and exits 0.So Check Spelling, Check Prose, Check Markdown, Check page meta and Check slurm scripts have been green without running. Only
Test buildwas doing real work. The::info::Workflow triggered by PRline printed unconditionally, so the log asserted a trigger that hadn't happened.Fix
Fall back to the repository default branch when
base_refis empty, and fail the step outright if the base ref can't be resolved. Silently linting nothing is worse than a red job, because it reads as a pass — that's what let this sit unnoticed.The base is passed through
env:rather than interpolated into the script.Verification
Run locally against #1355, which changes 167 pages:
The old command yields an empty list on the same branch. The no-docs-changed case still works —
grepfinding no matches no longer aborts the step underbash -e.Note this PR changes no
docs/*.md, so its own run will legitimately report an empty list. The fix is exercised for real by the next PR that touches documentation.Scope
Only the
pushandrepository_dispatchpaths were affected. Theworkflow_dispatchpath suppliesfileListexplicitly and is unchanged.Heads up that once this lands, PRs may start surfacing lint findings on pages that have never actually been checked.
🤖 Generated with Claude Code