Skip to content

Add CI check to catch broken documentation links in README #949

Description

@pulorsok

Problem

The report links in the README point to documentation pages/anchors that don't exist (e.g. quark_rules.html, which is not a real page). There is currently no automated check, so broken links only get noticed when someone finds them manually. The README has 21 of these doc links.

Plan

After the docs are built in CI, compare the README links against the build output; fail the check (blocking merge) on any mismatch.

  1. Add a script docs/check_readme_links.py that does three things:

    • Extract every link in README.md that points to our own docs (e.g. .../malware_report.html#brata, where the part after # is a section anchor).
    • Check that the target page exists in the built docs.
    • Open that page and confirm the anchor (section) actually exists in it.

    If any of the three fails, the script reports failure.

  2. Run this check automatically on every PR / push to master: checkout -> build the docs to HTML (sphinx-build docs/source docs/_build/html) -> run the script. If a broken link is found, the check fails and the PR cannot be merged. It is a standalone job and does not affect the existing tests. (A new workflow file .github/workflows/docs-link-check.yml.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions