feat(actions): check-docs, the contract checks on a docs repo's pull request - #102
Merged
Merged
Conversation
…request A third composite action. It runs the same checker publish-docs runs at release time (actions/lib/check.js, rules in contract/RULES.md) on a docs repo's manifest and built headless output, without packing or uploading anything, so a finding that would fail the publish fails the pull request instead, one release earlier. - Errors fail the check; warnings only with strict: true. - One annotation per rule, with a count and the first example: a docs template repeats one finding on every page, and GitHub shows only the first few annotations of a step. The job summary tables every rule and lists every finding. - Paths go in as the repo wrote them, so findings name kb-docs.json and dist/..., not runner paths. Outputs: errors, warnings. - The private-registry inputs the other actions have. The CLI's manifest/output resolution becomes checkWorkspace() and the build's by-rule grouping becomes summarise(), both in check.js, shared by the CLI, this action and the knowledge base build. annotate() can emit titled warnings. The private-registry spec now discovers every actions/*/action.yml instead of listing two, so a new action cannot ship without those inputs. CI runs ./actions/check-docs itself, strict, on the clean single-page fixture, next to its self-test. The kb-docs-add audit report offers the PR check, and writes it only if the user asks. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Adds a third composite action,
actions/check-docs. It runs the knowledge base contract checks on a docs repo's pull request.It uses the same checker
publish-docsruns at release time (actions/lib/check.js, rules incontract/RULES.md), on the repo's manifest and built headless output. It never packs or uploads anything. A finding that would fail the publish now fails the pull request instead, one release earlier.Behaviour
publish-docsrefuses to release. Warnings fail it only withstrict: true.KB-HTML-004 ×2, e.g. demo/…). A docs template repeats one finding on every page, and GitHub shows only the first few annotations of a step.kb-docs.jsonanddist/…, not runner paths.manifest,dist,strict, and the four private-registry inputs the other actions have. Outputs:errors,warnings.publish-single-page-docsrepo has no built output of its own to check.Supporting changes
checkWorkspace()and the build's by-rule grouping becomessummarise(), both incheck.js. The CLI, this action and the knowledge base build all use them.runner.js.annotate()can now emit titled warnings as well as errors.tests/private-registry.spec.jsnow discovers everyactions/*/action.ymlinstead of listing two, so a new action cannot ship without the private-network inputs../actions/check-docsitself, withstrict: 'true', on the clean single-page fixture. It asserts 0 errors and 0 warnings, so the composite is exercised on a real runner and not only through its entry point.kb-docs-addaudit report offers the PR check, and writes that workflow only if the user asks. This keeps the skill's "minimum files" rule.actions/check-docs/README.md,contract/RULES.md→ "Running the checks", the main README andCLAUDE.md.Testing
npm run selftestinactions/passes, including the newcheck-docsself-test. Its 7 cases:KB-MAN-001;manifest/distpaths.npm test: 386 of 386 passed.After merge
Docs repos get
check-docs@v1only once av1.2.0tag movesv1.Refs #67. Inline handlers (
KB-HTML-005) are now reported on the docs repo's own pull request, where they can be fixed at the source.🤖 Generated with Claude Code