docs(readme): show the checkout the action needs - #50
Conversation
The first snippet a consumer copies had no checkout step, and the action's default path builds its file list from `git ls-files` in the workspace. Outside a work tree that finds nothing, and the step is written with `set -uo pipefail` rather than `-e` with the command inside a process substitution, so the failure does not propagate: the run reports no files and exits 0. A gate spelled `fail-on-change: 'true'` therefore passes by inspecting nothing, which is the worst shape a copied gate can have -- green, and green for a reason nobody looks at. Reproduced in a directory that is not a repository: zero files, exit 0. The recipe further down the same section already checks out, so the two snippets disagreed and the shorter one was the one a reader takes first. The sentence about `paths` now says where "tracked" comes from, which is what makes the step above it load-bearing rather than boilerplate. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can add REVIEW.md to your repo root and Qodo follows it on every PR |
PR Summary by QodoDocument required checkout step for GitHub Action
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #50 +/- ##
=======================================
Coverage 87.37% 87.37%
=======================================
Files 3 3
Lines 689 689
=======================================
Hits 602 602
Misses 87 87 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟢 Approval recommended
The change is documentation-only and corrects a concrete, high-impact usage footgun without altering runtime behavior.
Pull request overview
This PR updates the README’s “As a GitHub Action” usage guidance to reflect a required actions/checkout step, so the action’s default file discovery (via git ls-files in the workspace) actually finds and inspects tracked Markdown files.
Changes:
- Add an explicit
actions/checkout@v7step to the first GitHub Action snippet so consumers don’t accidentally run the action outside a git worktree. - Expand the
pathsexplanation to clarify that “tracked” comes fromgit ls-files, and that omitting checkout can lead to a silent no-op that still exits 0.
File summaries
| File | Description |
|---|---|
| README.md | Adds the missing checkout step to the primary action snippet and clarifies why it’s required due to git ls-files-based discovery. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
What changes, and why
The first snippet in "As a GitHub Action" — the one a consumer copies first — had no checkout step:
The action's default path builds its file list from
git ls-files -z '*.md' '*.markdown'run in the workspace (action.yml:235). Outside a git work tree that finds nothing — and the step is written withset -uo pipefailrather than-e, with the command inside a process substitution, so the failure does not propagate:So a gate spelled
fail-on-change: 'true'passes by inspecting nothing — green, and green for a reason nobody looks at. That is the worst shape a copied gate can take.The "Fixing instead of failing" recipe further down the same section already begins with
- uses: actions/checkout@v7, so the two snippets disagreed and the shorter one is the one a reader takes first. It now matches.The sentence about
pathsalso says where "tracked" comes from, which is what makes the checkout load-bearing rather than boilerplate a reader might trim.Corpus
The corpus is the specification, and both implementations answer to it. Tick what applies.
corpus/pins the new behavior. The case was written first and failed first.Documentation of how to invoke the action.
action.ymlis unchanged — whether the silent-pass behaviour should itself be an error is a separate question, and this PR only stops the docs from walking a consumer into it.Checks
make checkpasses, ormake testdoes and this touches no Rust.make tidy, plusunwrap-markdown-prose-py --fail-on-change README.md.