Skip to content

Merging to release-5.12: DX-2361: Add GitHub Actions to validate external URLs and internal anchor fragments (#1865) - #1868

Merged
sharadregoti merged 1 commit into
release-5.12from
merge/release-5.12/88b1aa06d50d65583f19fd72fe58e1af03eb7f1d
Apr 11, 2026
Merged

Merging to release-5.12: DX-2361: Add GitHub Actions to validate external URLs and internal anchor fragments (#1865)#1868
sharadregoti merged 1 commit into
release-5.12from
merge/release-5.12/88b1aa06d50d65583f19fd72fe58e1af03eb7f1d

Conversation

@buger

@buger buger commented Apr 11, 2026

Copy link
Copy Markdown
Member

DX-2361: Add GitHub Actions to validate external URLs and internal anchor fragments (#1865)

  • DX-2361: Add GitHub Actions to validate external URLs and internal anchors
  • Extend validate_mintlify_docs.py with --check-anchors flag that extracts
    GFM-slugified heading anchors, {#custom-id} syntax, and <a id/name> elements
    from target MDX files and verifies every internal #fragment resolves
  • Update validate-docs.yml to run anchor check on every PR
  • Add check-external-links.yml workflow: weekly scheduled (Mon 07:00 UTC) and
    manual-trigger run that HEAD-checks all external HTTP/HTTPS URLs

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

  • DX-2361: Run external link check on every pull request

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

  • DX-2361: Fix exit code not failing on broken external links

External link failures were reported but never factored into the
exit code, so CI was passing despite 404s. Added has_broken_external
check and a summary line for external link results.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

  • DX-2361: Switch external link checker to lychee

Replace sequential Python/requests approach with lycheeverse/lychee-action.
Lychee runs checks in parallel, has built-in retry logic, and is purpose-built
for link checking — much faster on a repo with 1500+ external URLs.

Add lychee.toml to exclude tyk-owned domains, localhost, placeholder URLs,
and sites known to block bots (LinkedIn, Facebook). Accept 429 as non-broken
to handle rate-limited responses gracefully.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

  • Fix mirror-pr workflow failing on PR bodies with special characters

GitHub Actions expands ${{ }} expressions before the shell runs, so
backticks and $ signs in PR bodies were injected raw into the script
and interpreted as shell command substitution.

Fix: write static content via a single-quoted heredoc (no shell
expansion), then append the PR body via printf with an env var
($PR_BODY). Shell variables accessed as "$VAR" are never
re-interpreted, making any PR body content safe.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

  • Fix lychee checking internal/relative links

Add scheme = ["https", "http"] to lychee.toml so lychee only attempts
to check http/https URLs. Without this, lychee tries to resolve
root-relative paths (/img/..., /page/...) as file URIs and fails.
Internal links are already validated by validate-docs.yml.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

  • Fix lychee erroring on root-relative paths

scheme = ["https", "http"] didn't help because lychee fails to build
the URL before the scheme filter runs. Set base = "https://tyk.io" so
root-relative paths (/img/..., /page/...) are resolved to
https://tyk.io/... and then silently skipped by the existing tyk.io
exclude rule, rather than producing "cannot convert path to URI" errors.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

  • Fix lychee config: base -> base_url

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com


Co-authored-by: Claude Sonnet 4.6 noreply@anthropic.com

…chor fragments (#1865)

* DX-2361: Add GitHub Actions to validate external URLs and internal anchors

- Extend validate_mintlify_docs.py with --check-anchors flag that extracts
  GFM-slugified heading anchors, {#custom-id} syntax, and <a id/name> elements
  from target MDX files and verifies every internal #fragment resolves
- Update validate-docs.yml to run anchor check on every PR
- Add check-external-links.yml workflow: weekly scheduled (Mon 07:00 UTC) and
  manual-trigger run that HEAD-checks all external HTTP/HTTPS URLs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* DX-2361: Run external link check on every pull request

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* DX-2361: Fix exit code not failing on broken external links

External link failures were reported but never factored into the
exit code, so CI was passing despite 404s. Added has_broken_external
check and a summary line for external link results.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* DX-2361: Switch external link checker to lychee

Replace sequential Python/requests approach with lycheeverse/lychee-action.
Lychee runs checks in parallel, has built-in retry logic, and is purpose-built
for link checking — much faster on a repo with 1500+ external URLs.

Add lychee.toml to exclude tyk-owned domains, localhost, placeholder URLs,
and sites known to block bots (LinkedIn, Facebook). Accept 429 as non-broken
to handle rate-limited responses gracefully.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix mirror-pr workflow failing on PR bodies with special characters

GitHub Actions expands ${{ }} expressions before the shell runs, so
backticks and $ signs in PR bodies were injected raw into the script
and interpreted as shell command substitution.

Fix: write static content via a single-quoted heredoc (no shell
expansion), then append the PR body via printf with an env var
($PR_BODY). Shell variables accessed as "$VAR" are never
re-interpreted, making any PR body content safe.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix lychee checking internal/relative links

Add scheme = ["https", "http"] to lychee.toml so lychee only attempts
to check http/https URLs. Without this, lychee tries to resolve
root-relative paths (/img/..., /page/...) as file URIs and fails.
Internal links are already validated by validate-docs.yml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix lychee erroring on root-relative paths

scheme = ["https", "http"] didn't help because lychee fails to build
the URL before the scheme filter runs. Set base = "https://tyk.io" so
root-relative paths (/img/..., /page/...) are resolved to
https://tyk.io/... and then silently skipped by the existing tyk.io
exclude rule, rather than producing "cannot convert path to URI" errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix lychee config: base -> base_url

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
(cherry picked from commit 88b1aa0)
@github-actions

Copy link
Copy Markdown

Failed to generate code suggestions for PR

@sharadregoti
sharadregoti disabled auto-merge April 11, 2026 15:50
@sharadregoti
sharadregoti merged commit 62098f2 into release-5.12 Apr 11, 2026
2 of 4 checks passed
@sharadregoti
sharadregoti deleted the merge/release-5.12/88b1aa06d50d65583f19fd72fe58e1af03eb7f1d branch April 11, 2026 15:51
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.

2 participants