Validate codeblock URLs during build and streamline CI lints#3020
Merged
Validate codeblock URLs during build and streamline CI lints#3020
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
In |
a11c901 to
e794dc6
Compare
7bf9d01 to
ae58e94
Compare
Contributor
Author
Done! |
NWylynko
reviewed
Feb 6, 2026
NWylynko
reviewed
Feb 6, 2026
NWylynko
reviewed
Feb 6, 2026
- Add scripts/check-codeblock-links.ts to validate clerk.com/docs URLs in code block comments against built docs - Fix 4 outdated URLs found by the new checker - Update .github/workflows/lint.yml to run all lint checks after build - Add lint:check-codeblock-links script to package.json Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move codeblock URL validation from standalone script into the existing validateLinks remark plugin. This validates clerk.com/docs URLs in code block comments during the build process. Changes: - Add codeblock URL validation to validateLinks.ts - Detect URLs that redirect and suggest the correct path - Preserve hash fragments in redirect suggestions - Add 'link-redirects' error message - Pass redirects to validateLinks for redirect chain resolution - Remove standalone check-codeblock-links.ts script Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove build step from lint workflow and run only lints that don't require built artifacts: formatting, frontmatter, duplicate redirects, SVGs, and images. Build-dependent validations (like codeblock URL checking) run as part of the build process itself. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
4b37177 to
c93a3b1
Compare
Derive redirectsForValidation from existing variables instead of storing a separate copy of the raw redirect arrays. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ink-checker # Conflicts: # .github/workflows/lint.yml
- Remove redirect chain logic (followRedirectChain, link-redirects error, redirect params) per reviewer feedback — just use link-doc-not-found - Add unit tests for codeblock URL validation - Ignore link-doc-not-found for auto-generated API error docs - Fix outdated session-tasks URLs in code block comments Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
NWylynko
approved these changes
Mar 23, 2026
manovotny
added a commit
that referenced
this pull request
Mar 26, 2026
PR #3227 replaced hardcoded SDK cards with a dynamic `SDKCards` component, removing the `community-sdks.mdx` partial that referenced these images. The image files themselves were not deleted, leaving them orphaned and failing `lint:check-images`. The lint didn't catch this on PR #3227 because of a timing issue: `lint:check-images` was added to the CI lint workflow in PR #3020 (merged 2026-03-23), but the CI run for PR #3227 executed on 2026-03-18 — five days before the check existed. The PR was then merged on 2026-03-26 using that stale passing CI result. Deleted files: - public/images/logos/sdks/angular.svg - public/images/logos/sdks/elysia.svg - public/images/logos/sdks/hono.svg - public/images/logos/sdks/koa-dark.svg - public/images/logos/sdks/koa.svg - public/images/logos/sdks/rust.svg - public/images/logos/sdks/solidjs.svg - public/images/logos/sdks/svelte.svg Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Warning
These upstream changes will need to be merged before the build will pass (because they contain broken or out-of-date URLs):
https://github.com/clerk/clerk_go/pull/16481✅chore: Update API Errors #3216✅Summary
clerk.com/docsURLs found in code block commentsWhat changed?
Build-time codeblock URL validation
Updated
scripts/lib/plugins/validateLinks.tsto validateclerk.com/docsURLs found in code block comments during the build process:https://clerk.com/docs/*backend-api.mdx,frontend-api.mdx) are excluded fromlink-doc-not-foundwarnings since their URLs come from upstreamCI workflow changes
Updated
.github/workflows/lint.ymlto run all lints that don't require a build:lint:formatting- Prettier checklint:check-frontmatter- Frontmatter validationlint:check-duplicate-redirects- Duplicate redirect checklint:check-svgs- SVG optimization checklint:check-images- Image reference checklint:check-description-backticks- Description backtick checklint:check-prompt-deeplink-length- Prompt deeplink length checkLints requiring a build (
lint:check-redirects) are now validated as part of the build process itself.Fixed URLs
Fixed outdated
clerk.com/docsURLs found in code blocks:/docs/quickstarts/nextjs→/docs/nextjs/getting-started/quickstart/docs/custom-flows/error-handling→/docs/guides/development/custom-flows/error-handling/docs/reference/tanstack-react-start/custom-sign-in-or-up-page→/docs/guides/development/custom-sign-in-or-up-page/docs/references/backend/types/auth-object→/docs/reference/backend/types/auth-object/docs/authentication/enterprise-connections/authentication-flows→/docs/guides/configure/auth-strategies/enterprise-connections/authentication-flows/docs/guides/development/custom-flows/overview#session-tasks→/docs/guides/development/custom-flows/authentication/session-tasksUnit tests
Added integration tests for codeblock URL validation in
scripts/build-docs.test.ts:Test plan
pnpm run buildpnpm run lint:formattingpnpm run test(excluding pre-existingmove-doc.test.tsfailures on main)🤖 Generated with Claude Code