ci: add GitHub Actions workflow for documentation validation#5392
Open
Nokhrin wants to merge 1 commit into
Open
ci: add GitHub Actions workflow for documentation validation#5392Nokhrin wants to merge 1 commit into
Nokhrin wants to merge 1 commit into
Conversation
c576e36 to
adbfb7f
Compare
adbfb7f to
575a1c4
Compare
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.
Summary
This PR proposes adding automated documentation link validation using
docs-validator, a Python-based static analyzer that detects broken links, orphan files, missing anchors, and circular dependencies in documentation repositories.Experiment Results
I've tested this tool on the OpenAPI-Specification repository to demonstrate its value. The validation completed in ~45 seconds and analyzed 57 documentation files containing 1,240 links (17 internal, 1,223 external).
Metrics
Real Issues Discovered
1. Broken Internal Links (9 errors)
versions/3.0.2.md:1846→../examples/v3.0/callback-example.yaml(file not found)versions/3.1.0.md:198→../examples/v3.1/webhook-example.yaml(file not found)_archive_/schemas/v3.0/README.md:38→../../tests/v3.0(file not found)2. Broken External Links (29 errors)
versions/1.2.md:92→http://json-schema.org/latest/json-schema-core.html#anchor8(404)proposals/2019-01-01-Proposal-Template.md:9→https://github.com/{author2}(404, template placeholder)proposals/2024-09-01-Tags-Improvement.md:61→https://example.com/shopping(404)3. Orphan Files (52 warnings)
Files without incoming links, potentially undiscoverable:
versions/3.0.0.md,versions/3.1.0.md,versions/3.2.0.md(historical versions)proposals/*.md(15 proposal files).github/pull_request_template.md,.github/ISSUE_TEMPLATE/*.md4. Manual Verification Required (46 warnings)
Resources blocked by WAF or rate-limited:
style-guide.md:7→https://www.npmjs.com/package/markdownlint(403, Cloudflare)versions/3.1.2.md:3503→https://www.w3.org/TR/xml-names11/(403)proposals/2019-10-31-Clarify-Nullable.md:9→https://github.com/tedepstein(429, rate limit)Benefits for OpenAPI-Specification
Configuration
The workflow is configured to:
.md,.markdown,.asc,.adoc)Known Limitations
The following limitations are documented for transparency:
References
I'm happy to adjust the workflow configuration, add a
.docs-validator.tomlfile with project-specific exclusions, or make any other changes based on maintainer feedback.