test(ci): make lint-readme-parity bidirectional#205
Conversation
Catch README rows that document an input/output no longer declared in action.yaml (rename/removal drift) in addition to the existing declared->documented check. Reads only the table's first column. Fixes #204
Code Coverage OverviewLanguages: Go, C# Go / code-coverage/testThe overall coverage remains at 50%, unchanged from the branch. C# / code-coverage/dotnetThe overall coverage remains at 100%, unchanged from the branch. Updated |
There was a problem hiding this comment.
Pull request overview
Extends the existing lint-readme-parity CI job in .github/workflows/ci.yaml with a reverse direction check: every name appearing in a README's ## Inputs / ## Outputs markdown table first column must correspond to a declared input/output in the action's action.yaml. This catches stale README rows left behind by renames/removals, which the prior forward-only check missed. Per issue #204 / epic #181, this hardens the library so README↔action.yaml parity is mechanically enforced in both directions.
Changes:
- Add
sectionandtable_namesawk helpers;table_namesreads only the markdown table's first column (skipping header and|---|separator rows, stripping backticks) to avoid false positives from prose code spans. - Refactor the forward check to consume cached
declared_in/declared_outlists and add symmetric reverse-direction loops that emit::error file=$readme::…annotations. - Update the success message to reflect the bidirectional guarantee.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #204.
What
Makes the
lint-readme-parityCI job bidirectional. It already failed when a declared input/output was missing from a README (forward); this adds thereversedirection — every name in a README's## Inputs/## Outputstable first column must be a declared input/output inaction.yaml.Why
The forward-only check is blind to the drift a rename/removal leaves behind: dropping or renaming an input in
action.yamlkeeps the forward check green (nothing newly undocumented) while the README retains a now-phantom row. This repo has done exactly those changes —require-checks → aggregate-job-checks(v3),setup-copilot-skills → setup-agent-skills(v5), Codecov input/secret removal (v5) — so stale rows are a real, recurring risk. This finishes epic #181's goal of a library "mechanically inspectable for correctness, not just by social convention."How
table_namesawk helper reads only the table's first column (skips the header and|---|separator rows; strips backticks) — so prose code-spans don't false-positive (the naive whole-section scan does, verified and rejected).Validation (local, against this branch's tree)
actionlint 1.7.12— no new findings (only the two pre-existingcode-qualitypermission-scope warnings, unrelated).yamllint 1.38.0— clean.'ghost' is documented in ## Inputs but not declared in …, exit 1);Opened as a draft per the maintenance contract; promote to signal go.