Skip to content

feat: publish the offline checks as a GitHub Action for other repositories - #51

Merged
drevendev merged 1 commit into
masterfrom
beautifulrepo/reusable-checks-action-20261022
Oct 22, 2026
Merged

drevendev merged 1 commit into
masterfrom
beautifulrepo/reusable-checks-action-20261022

Conversation

@drevendev

Copy link
Copy Markdown
Owner

Reader problem and change

Another repository can't adopt BeautifulRepo's checks today without copying scripts, and there's no version it can pin. This PR publishes the audit and both link checks as a GitHub Action:

- uses: drevendev/BeautifulRepo@<full-commit-sha>
  with:
    exclude: |
      vendor
  • action.yml (composite) runs tools/repo_audit.py, tools/docs_links.py and tools/html_navigation.py from the action's own checkout ($GITHUB_ACTION_PATH). Inputs: path, checks, audit-fail-on, exclude. It uses the caller's Python 3.11+ rather than installing one, so the caller's environment is left alone. Inputs reach scripts only through env:, which avoids expression injection. An unknown check name fails the step instead of being silently skipped.
  • Tools: docs_links.py and html_navigation.py never scan .git or node_modules, and accept a repeatable --exclude GLOB. Excluded files are still valid link destinations.
  • CI self-test (Action self-test (ubuntu-latest | windows-latest), Python 3.11) runs the action on this repository, then on a generated fixture where a broken link and a typo in checks must fail, and exclude: vendor must pass. The existing Python 3.11, Python 3.14 and Python 3.14 (Windows) job names are unchanged.
  • guides/adopting-the-checks.md covers a copy-paste workflow, inputs, a rollout without a wall of red, and SHA pinning. It is linked from README (This repository checks itself and Maintain evidence and trust) and from tools/README.md.

Why a composite action, not a reusable workflow

A reusable workflow (on: workflow_call) can't tell which ref the caller used, so it would need a second checkout of BeautifulRepo at a separately supplied ref, and the workflow and tool versions could drift apart. A composite action gets its tools from exactly the commit the caller pinned.

Evidence

  • Foreign repositories: I ran the tools against seven unpublished local repositories before the change. In two of them nearly all link findings came from installed node_modules packages: 125 and 242 findings in one, 21 and 29 in the other. After the change both pass, scanning 49 and 48 repository-owned Markdown files. The remaining real findings elsewhere were a missing screenshot and a github.com/... link without a scheme.
  • Sources reviewed on 2026-10-22 (cited in the guide): GitHub Docs on metadata syntax (composite actions, $GITHUB_ACTION_PATH) and on secure use (pin to a full SHA, tags can move, Dependabot updates SHA pins but does not alert on them).

Verification

  • Catalog validation and generated-view check completed (python tools/catalog.py → OK).
  • Relevant tests passed: python -m unittest discover -s tests → Ran 231 tests ... OK (skipped=5) on Windows 11 / Python 3.14.7. New tests are tests/test_markdown_source_selection.py (behavior) and tests/test_action_contract.py (structure).
  • Documentation links and examples were inspected: docs_links.py → 182 destinations across 42 files OK; html_navigation.py → 193 OK; repo_audit.py . → 0 findings.
  • The action's shell steps were also run locally in Git Bash: a broken link fails, exclude passes, an unknown check and a bad path fail, and the python3 → python fallback works.
  • Accessibility and visual checks: not applicable (no rendered surface changed).

Limitations

  • macOS runners aren't tested.
  • The action doesn't produce PR annotations. Findings are printed in the job log.
  • There is no tagged release yet, so the guide tells consumers to pin a reviewed master commit.

Proposed first release (owner decision, not done by this PR)

After merge, I suggest tagging the merge commit as v0.1.0:

v0.1.0: BeautifulRepo checks as a pinnable GitHub Action

What changed: Other repositories can run BeautifulRepo's README/license/contribution audit and its offline Markdown link and anchor checks with uses: drevendev/BeautifulRepo@<sha>, without copying scripts.

Upgrade notes: First release, nothing to upgrade. Pin the commit SHA this tag points to, not the tag name.

Breaking changes: None. docs_links.py and html_navigation.py now skip node_modules Markdown sources.

Added: composite action action.yml · --exclude for both link checkers · adoption guide.

Fixed (since the repository began): Windows checkouts now pass every documented check (#50).

Known issues: no macOS CI. No PR annotations. The checks are bounded source inspections, not a renderer, link crawler or accessibility certification.

Verification: tag / commit to be filled in at tagging, with the CI run on that exact commit.

Tagging would also mean replacing this CHANGELOG sentence: "not packaged releases or version tags".

🤖 Generated with Claude Code

…ories

Other repositories could not consume BeautifulRepo's checks without
copying scripts, and had no way to pin a version.

- action.yml: composite action running repo_audit, docs_links and
  html_navigation from its own checkout, so the tools always match the
  commit the caller pinned. It uses the caller's Python 3.11+, passes
  inputs only through env, and rejects unknown check names.
- docs_links/html_navigation never scan .git or node_modules and accept a
  repeatable --exclude glob; excluded files remain link destinations.
- CI self-test runs the action on Ubuntu and Windows with Python 3.11,
  including a broken link and a typo that must fail.
- guides/adopting-the-checks.md: copy-paste workflow, inputs, rollout
  steps and SHA pinning, linked from README and tools/README.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@drevendev
drevendev merged commit 96e04e6 into master Oct 22, 2026
5 checks passed
@drevendev
drevendev deleted the beautifulrepo/reusable-checks-action-20261022 branch October 22, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant