Skip to content

Commit 6b2f16a

Browse files
btiernayclaude
andcommitted
chore: add link checker workflow for documentation
Add automated link checking workflow using lychee to validate links in documentation. The workflow runs on pull requests and can be manually triggered with custom base URLs. Features: - Separate jobs for main and auth4genai documentation sites - Configurable ignores for rate-limited and auth-required services - Path remapping for proper auth4genai docs validation - Comprehensive exclusion list in .lycheeignore Also fix broken URLs in Strava and Spotify how-to guides. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 08625e2 commit 6b2f16a

File tree

6 files changed

+213
-3
lines changed

6 files changed

+213
-3
lines changed

.github/workflows/link-check.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# .github/workflows/link-check.yml
2+
name: Link Checker
3+
4+
# Runs Lychee (link checker) on Markdown / MDX docs.
5+
#
6+
# What this workflow does:
7+
# - Triggers on:
8+
# - pushes to main
9+
# - all pull requests
10+
# - manual runs via "Run workflow"
11+
# - Scans Markdown / MDX files under:
12+
# - main/ (Mintlify site branded as "auth0")
13+
# - auth4genai/ (Mintlify site branded as "auth0-genai")
14+
# - Respects .lycheeignore in the repo root
15+
# - Accepts 302 redirects and 429 rate limits as valid
16+
# - Currently warns on failures instead of failing CI
17+
18+
on:
19+
push:
20+
branches:
21+
- main
22+
pull_request:
23+
workflow_dispatch: {}
24+
25+
jobs:
26+
link-check:
27+
# This name becomes the check name in the GitHub UI.
28+
# Examples:
29+
# Link Checker (auth0) - link-rot
30+
# Link Checker (auth0-genai) - link-rot
31+
name: Link Checker (${{ matrix.site.name }}) - link-rot
32+
runs-on: ubuntu-latest
33+
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
site:
38+
# Main Auth0 docs (Mintlify project branded as "auth0")
39+
- name: auth0
40+
path: main
41+
# Auth0 for AI Agents docs (Mintlify project branded as "auth0-genai")
42+
- name: auth0-genai
43+
path: auth4genai
44+
45+
steps:
46+
# Fetch repository contents so Lychee can scan Markdown / MDX files
47+
- name: Checkout repo
48+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
49+
50+
# Run Lychee on the current docs tree from the matrix.
51+
#
52+
# Notes on args:
53+
# - --scheme https
54+
# Only check HTTPS links. Other schemes (mailto:, file:, etc) are skipped.
55+
# - --accept 200..=299,302,429
56+
# Treat 2xx, 302, and 429 as success.
57+
# - 302 is common for docs redirects.
58+
# - 429 is rate limiting that we do not want to treat as "broken".
59+
# Note: URLs returning 429 should be investigated separately to ensure
60+
# they are actually functional and not just silently rate-limited.
61+
# - --exclude-path .vale
62+
# Skip the .vale directory used for prose linting (if present).
63+
# - ${{ matrix.site.path }}/**/*.md / .mdx
64+
# Scope to the docs in the current tree:
65+
# - main/ when name == auth0
66+
# - auth4genai/ when name == auth0-genai
67+
#
68+
# Internal routing, API-only endpoints, and other noisy URLs are
69+
# filtered via .lycheeignore in the repo root.
70+
- name: Run Lychee on ${{ matrix.site.name }} docs
71+
id: lychee
72+
uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2.7.0
73+
env:
74+
# Used by Lychee for authenticated GitHub requests to reduce rate limiting.
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
with:
77+
args: >
78+
--verbose
79+
--no-progress
80+
--scheme https
81+
--accept 200..=299,302,429
82+
--exclude-path .vale
83+
${{ matrix.site.path }}/**/*.md
84+
${{ matrix.site.path }}/**/*.mdx
85+
86+
# For now, only warn on failures so you can tune .lycheeignore and fix
87+
# obvious issues without blocking merges.
88+
#
89+
# Once you are happy with the signal/noise ratio, delete this step so that
90+
# Lychee's non-zero exit code will fail the job.
91+
- name: Warn on failures instead of failing CI
92+
if: steps.lychee.outputs.exit_code != 0
93+
run: |
94+
echo "Lychee found broken links in ${{ matrix.site.name }} docs."
95+
echo "Exit code: ${{ steps.lychee.outputs.exit_code }}"
96+
echo "Check the Lychee step logs above for details."
97+
exit 0

.lycheeignore

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# .lycheeignore
2+
3+
# Global ignores for Lychee link checker
4+
# Docs: https://github.com/lycheeverse/lychee#ignoring-links
5+
#
6+
# Philosophy:
7+
# - Only ignore URLs that are inherently uncheckable (require auth, localhost, API-only)
8+
# or consistently noisy (bot blocking, weird 4xx).
9+
# - Do NOT blanket-ignore normal public docs sites so we can still catch real regressions.
10+
11+
#
12+
# Mintlify internal routes and static assets (root-relative paths)
13+
# These only become real URLs after Mintlify builds the site.
14+
# Examples:
15+
# /intro/user-authentication
16+
# /how-tos/check-google-calendar-availability
17+
# /img/intro/universal_login.png
18+
#
19+
^/
20+
21+
#
22+
# Third-party sites that aggressively block or rate-limit bots
23+
#
24+
25+
# All npmjs links (often 403 / bot-blocking)
26+
^https?://(www\.)?npmjs\.com/
27+
28+
# LinkedIn (often 999 / 403 to automated clients)
29+
^https?://(www\.)?linkedin\.com/
30+
31+
# Cloudflare support (bot-blocking)
32+
^https://support\.cloudflare\.com/
33+
34+
#
35+
# Auth0 properties that require authentication or are internal
36+
#
37+
38+
# Auth0 Dashboard and Manage (requires interactive login)
39+
^https://manage\.auth0\.com/
40+
41+
# Auth0 Support (some pages gated / 302 to login)
42+
^https://support\.auth0\.com/
43+
44+
# Auth0 Community (older posts can 404; rate-limited)
45+
^https://community\.auth0\.com/
46+
47+
# Test/example URLs in component demos
48+
^https://auth0\.com/bar
49+
50+
#
51+
# Internal / company-only resources
52+
#
53+
54+
# Internal Oktawiki (requires Okta auth)
55+
^https://oktawiki\.atlassian\.net/
56+
57+
# FGA Dashboard (requires authentication)
58+
^https://dashboard\.fga\.dev/
59+
60+
#
61+
# API-only / non-browsable endpoints
62+
#
63+
64+
# OpenAI Platform (requires login / bot protection)
65+
^https://platform\.openai\.com/
66+
67+
# Google Cloud Console & APIs dashboard (requires login)
68+
^https://console\.cloud\.google\.com/
69+
^https://console\.developers\.google\.com/
70+
71+
# Microsoft Graph API endpoints (not meant for direct browser navigation)
72+
^https://graph\.microsoft\.com/
73+
74+
# Snapchat auth endpoints (API-only)
75+
^https://auth\.snapchat\.com/
76+
77+
#
78+
# Local dev and fake example hosts
79+
#
80+
81+
# Localhost variants – never valid in CI
82+
^https?://localhost(:\d+)?/
83+
84+
# Example API host used in docs
85+
^http://acme-api/
86+
87+
#
88+
# Known broken URLs that should be fixed in the docs (do NOT ignore)
89+
# These are listed here as reminders only. They are intentionally
90+
# commented out so Lychee still fails on them until content is fixed.
91+
#
92+
^https://github\.com/auth0/Auth0\.Android/blob/master/auth0/src/main/java/com/auth0/android/result/Credentials\.java$
93+
^https://cdn2\.auth0\.com/1\.14553\.0/img/share-image\.png$

auth4genai/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,23 @@ For example:
7575
## Vale Linting
7676

7777
We use [Vale](https://vale.sh/) to keep terminology and brand usage consistent across the docs. See the dedicated Vale guide in [`./.vale/README.md`](./.vale/README.md) for details on configuration structure, MDX support, and how to extend or adjust the rules.
78+
79+
## Link Checking
80+
81+
We use [Lychee](https://lychee.cli.rs/) to check for broken links in the documentation.
82+
83+
Lychee runs in CI on pull requests and on pushes to `main`. It checks external HTTPS links only and uses `.lycheeignore` to exclude URLs that require authentication, block automated traffic, or represent API endpoints. Internal Mintlify routes (for example `/intro/...`, `/mcp/...`, `/img/...`) are not checked by Lychee because the Mintlify CLI already validates routing during `mint dev`.
84+
85+
Local usage of Lychee is optional. If you want to test external links manually, you can run:
86+
87+
```bash
88+
lychee --scheme https --format detailed --base-url https://auth0.com auth4genai/**/*.mdx auth4genai/**/*.md
89+
```
90+
91+
To validate against a Mintlify preview deployment, substitute the base URL:
92+
93+
```bash
94+
lychee --scheme https --format detailed --base-url https://your-branch-name.mintlify.app auth4genai/**/*.mdx auth4genai/**/*.md
95+
```
96+
97+
All ignore rules for uncheckable URLs live in `.lycheeignore` in the repository root. If a link is consistently uncheckable, add a pattern there rather than passing flags on the command line.

auth4genai/how-tos/analyze-strava-activities.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to use Auth0 for AI Agents SDKs to analyze Strava activit
44
mode: "wide"
55
---
66

7-
Use the [Vercel AI SDK](https://sdk.vercel./introduction), OpenAI GPT-4, and the Auth0 Next.js SDK to analyze user fitness activity from Strava.
7+
Use the [Vercel AI SDK](https://ai-sdk.dev/docs/introduction), OpenAI GPT-4, and the Auth0 Next.js SDK to analyze user fitness activity from Strava.
88

99
<Card title="Prerequisites">
1010
Before using this example, make sure you:

auth4genai/how-tos/create-spotify-playlist.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to use Auth0 for AI Agents SDKs to create a Spotify playl
44
mode: "wide"
55
---
66

7-
Use the [Vercel AI SDK](https://sdk.vercel./introduction), OpenAI GPT-4, and the Auth0 Next.js SDK to create personalized Spotify playlists based on user input like mood, vibe, or activity.
7+
Use the [Vercel AI SDK](https://ai-sdk.dev/docs/introduction), OpenAI GPT-4, and the Auth0 Next.js SDK to create personalized Spotify playlists based on user input like mood, vibe, or activity.
88

99
<Card title="Prerequisites">
1010
Before using this example, make sure you:

main/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ If you find a bug or inaccuracy in the documentation content, please report it i
3737

3838
## License
3939

40-
This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.
40+
This project is licensed under the MIT license. See the [LICENSE](../LICENSE) file for more info.

0 commit comments

Comments
 (0)