Skip to content

chore: add content validation workflow - #10213

Open
oscarbol09 wants to merge 2 commits into
nilbuild:masterfrom
oscarbol09:chore/add-content-validation
Open

chore: add content validation workflow#10213
oscarbol09 wants to merge 2 commits into
nilbuild:masterfrom
oscarbol09:chore/add-content-validation

Conversation

@oscarbol09

Copy link
Copy Markdown

What

Adds a content validation workflow that runs on every pull request touching roadmaps/** content files, plus a reusable script scripts/validate-content.ts that can also validate the whole repository on demand (workflow_dispatch).

Validation rules (aligned with contributing.md)

For every changed roadmaps/*/content/*.md file the script checks:

  • File name must follow <topic-slug>@<node-id>.md
  • First line must be a non-empty # Topic Title heading
  • Resource links must follow - [@type@Title](url) with an allowed type (roadmap, official, opensource, article, course, podcast, video, book, feed — reused from allowedOfficialRoadmapTopicResourceType)
  • Max 8 resource links per topic (as documented in contributing.md)
  • No GeeksforGeeks links (as documented in contributing.md)
  • Duplicate node ids — a changed file is rejected if its roadmap-slug/node-id already 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_dispatch mode, 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.
  • --all on 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 --noEmit and prettier --check pass.

Notes

  • Runs on pull_request (paths: roadmaps/**, scripts/**, the workflow file itself) and workflow_dispatch (full validation).
  • Uses the same toolchain as the other workflows (pnpm@v11, Node 24, actions/checkout@v4).

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant