chore: add content validation workflow - #10213
Open
oscarbol09 wants to merge 2 commits into
Open
Conversation
Validates content files against the contributing guidelines: file naming, topic title, resource link format, allowed resource types, max 8 links per topic, no GeeksforGeeks links, and duplicate node ids.
Runs the content validation script on pull requests touching roadmaps content and supports manual full-repo validation via workflow_dispatch.
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.
What
Adds a content validation workflow that runs on every pull request touching
roadmaps/**content files, plus a reusable scriptscripts/validate-content.tsthat can also validate the whole repository on demand (workflow_dispatch).Validation rules (aligned with
contributing.md)For every changed
roadmaps/*/content/*.mdfile the script checks:<topic-slug>@<node-id>.md# Topic Titleheading- [@type@Title](url)with an allowed type (roadmap,official,opensource,article,course,podcast,video,book,feed— reused fromallowedOfficialRoadmapTopicResourceType)contributing.md)contributing.md)roadmap-slug/node-idalready exists in the repository under a different file name (this is what caused the stale-slug duplicates previously cleaned up)Existing repo-wide issues are only reported by the explicit
--all/workflow_dispatchmode, so existing content never blocks regular PRs.Verification
npm run validate:content -- --files=...on known-good files passes (exit 0) and fails (exit 1) on files missing the H1, exceeding 8 links, with invalid types, malformed links, GeeksforGeeks links, or duplicate node ids.--allon the current master reports 114 files/issues (missing titles, files with >8 links, malformed links, GeeksforGeeks links, and 58 duplicate node-id collisions).npx tsc --noEmitandprettier --checkpass.Notes
pull_request(paths:roadmaps/**,scripts/**, the workflow file itself) andworkflow_dispatch(full validation).pnpm@v11, Node 24,actions/checkout@v4).