Add MDX documentation validation to verify workflow#65
Merged
Conversation
Adds a docs job to the reusable verify workflow that validates docs/connector.mdx using compile-only MDX parsing (no eval/execution). Catches malformed tags, unclosed components, and unknown component names before they reach main. Security: - Compile-only: uses @mdx-js/mdx compile() without run(). No code from the PR is executed — safe for untrusted external contributor PRs. - Component allowlist checked against compiled output (not regex on raw MDX) to avoid false positives from angle brackets in inline text. - Minimal deps: @mdx-js/mdx, remark-gfm, remark-frontmatter only. No react/react-dom (only needed for rendering, not validation). The lint script is written inline in the workflow step (no cross-repo checkout needed). Packages are installed to /tmp/mdx-lint at runtime. Error messages show directly in the GitHub Actions log with file annotation on docs/connector.mdx.
ab87480 to
97a0e71
Compare
Bencheng21
approved these changes
Mar 24, 2026
btipling
approved these changes
Mar 24, 2026
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.
Why
Malformed MDX in
docs/connector.mdx(e.g. unclosed tags, indented closing tags, unknown components) causes the registry's documentation compiler to fail silently. The broken docs get recorded but never compiled to HTML, so they never render in the UI. Currently there's no way to catch this before merge.What this changes
Adds a
docsjob to the reusable verify workflow that compilesdocs/connector.mdxusing the same MDX compiler the registry uses. Runs on every PR in every connector repo.tools/mdx-lint/mdx-compile.mjs— the compiler (same as in the registry-api repo)tools/mdx-lint/package.json— minimal Node dependenciesdocs/connector.mdxexists (most connectors have it)Example failure this would catch: baton-zuora has
</Warning>indented inside a list item, which breaks the MDX parser.