ci: Add path and link validators#1070
Merged
Merged
Conversation
8c324a6 to
db743fb
Compare
862ad6a to
f352cbf
Compare
383972e to
857bed2
Compare
2 tasks
79ab453 to
bf3c806
Compare
Scans all markdown files for broken links: - Absolute docs.seam.co URLs: checks target exists in correct site section - Relative links: resolves from file location and checks target exists Skips images, anchors, GitBook templates, asset references, and file:// URIs. Groups output by broken target for readability. Run with: npm run validate-links Runs in CI as part of the Generate workflow after codegen. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Validates that file paths in SUMMARY.md are consistent with their section group heading. For example, a file listed under "## Developer Tools" must have a path starting with "developer-tools/". Usage: npm run validate-paths Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Runs the SUMMARY.md path validator after codegen, before link validation. Ensures file paths stay in sync with their section headings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move site section definitions (name, root, urlPrefix) into config.ts as the single source of truth. Both validate-paths and validate-links now read from the shared config instead of defining their own lists. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The catch-all Guides section (urlPrefix: '') was listed first, causing all /api/... URLs to match Guides instead of API Reference. Reorder so more-specific prefixes come first. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bf3c806 to
81a58e2
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
validate-pathsscript that checks SUMMARY.md file paths match their##section headingsvalidate-linksscript that checks all absolutedocs.seam.coURLs and relative markdown links resolve to existing filesUsage
How they work
validate-paths: Parses SUMMARY.md, tracks the current
##group heading, and verifies that each file path starts with the slugified heading (e.g., files under## Developer Toolsmust start withdeveloper-tools/).validate-links: Scans all
.mdfiles underdocs/, extractshttps://docs.seam.co/latest/...URLs and relative markdown links, maps them to the correct site section directory, and checks that the target file exists on disk.Current state
validate-pathsfinds 64 issues on main — fixed by Move all files to match their SUMMARY.md section headings #1079validate-linksfinds 475 broken links — all pre-existing URL/filepath mismatches handled by GitBook redirects today🤖 Generated with Claude Code