ci: add markdown internal-link checker - #62
Merged
Conversation
This repo is documentation-heavy with dense cross-linking between README.md, docs/, and mappings/ (and more mapping-file cross-references proposed in open issues like #59). Nothing currently catches a relative link or image path broken by a future rename/move — add scripts/check_links.sh, which resolves every relative markdown link against the filesystem and fails on any that don't exist, wired into CI as a new markdown-links job. External (http/mailto) links and anchors are intentionally skipped to avoid network flakiness in CI. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VKs7fC7VMaGgqu965dum4h
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
mappings/,docs/,templates/, andindustry-variants/, and several open issues (e.g. Framework mapping docs are missing the MFA and Ransomware Response policies #59) propose adding even more cross-references between mapping files. Nothing currently verifies that a relative markdown link or image path still resolves after a file is renamed or moved.scripts/check_links.sh: walks every*.mdfile, extracts relative link/image targets, and fails if any resolved path doesn't exist on disk. External links (http/https/mailto) and pure anchors (#section) are intentionally skipped so the check can't flake on network issues or rate limits..github/workflows/ci.ymlas a newmarkdown-linksjob, and adds the new script to the existingshellcheckjob's lint coverage.BROKEN: <file> -> <link>line when a bogus relative link is injected.Test plan
shellcheck scripts/customize.sh scripts/check_links.sh— no warningsbash scripts/check_links.shon currentmain— reports "All internal markdown links resolve correctly.".github/workflows/ci.ymlYAML syntaxGenerated by Claude Code