|
| 1 | +# .github/workflows/link-check.yml |
1 | 2 | name: Link Checker |
2 | 3 |
|
3 | 4 | # Runs Lychee (link checker) on Markdown / MDX docs. |
4 | | -# Lychee repo: https://github.com/lycheeverse/lychee |
5 | | -# GitHub Action: https://github.com/lycheeverse/lychee-action |
6 | | -# Config reference: https://github.com/lycheeverse/lychee#configuration |
7 | 5 | # |
8 | 6 | # What this workflow does: |
9 | | -# - Triggers on pushes to main, pull requests, and manual workflow dispatch |
10 | | -# - Scans all *.md and *.mdx files for broken links |
11 | | -# - Uses .lycheeignore in the repo root to ignore known noisy URLs |
12 | | -# - Accepts 302 redirects as valid (common for auth-required pages) |
13 | | -# - Currently warns on failures to allow tuning before enforcing |
14 | | -# |
15 | | -# Manual trigger: |
16 | | -# - Go to Actions tab → Select "Link Checker" → Click "Run workflow" |
17 | | -# - Specify custom base URL (e.g., Mintlify preview deployment) |
18 | | -# |
19 | | -# To make blocking: Remove the final "Warn on failures" step |
| 7 | +# - Triggers on: |
| 8 | +# - pushes to main |
| 9 | +# - all pull requests |
| 10 | +# - manual runs via "Run workflow" |
| 11 | +# - Scans auth4genai/*.md(x) for broken HTTPS links |
| 12 | +# - Respects .lycheeignore in the repo root |
| 13 | +# - Accepts 302 redirects and 429 rate limits as valid |
| 14 | +# - Currently warns on failures instead of failing CI |
20 | 15 |
|
21 | 16 | on: |
22 | 17 | push: |
23 | 18 | branches: |
24 | | - - main |
| 19 | + - main |
25 | 20 | pull_request: |
26 | | - workflow_dispatch: |
27 | | - inputs: |
28 | | - base_url: |
29 | | - description: 'Base URL for resolving absolute paths (e.g., https://auth0.com or https://your-preview.mintlify.app)' |
30 | | - required: false |
31 | | - default: 'https://auth0.com' |
32 | | - type: string |
| 21 | + workflow_dispatch: {} |
33 | 22 |
|
34 | 23 | jobs: |
35 | 24 | link-check: |
36 | | - name: Check external links |
| 25 | + name: Check external links in auth4genai docs |
37 | 26 | runs-on: ubuntu-latest |
38 | 27 |
|
39 | 28 | steps: |
40 | | - - name: Checkout repo |
41 | | - uses: actions/checkout@v4 |
42 | | - |
43 | | - # If your docs are generated (Next.js / Docusaurus / etc), you can build them here |
44 | | - # and point Lychee at the output instead. Examples in the action docs: |
45 | | - # https://github.com/lycheeverse/lychee-action#usage |
46 | | - # - name: Build docs |
47 | | - # run: | |
48 | | - # npm ci |
49 | | - # npm run docs:build |
| 29 | + # Fetch repository contents so Lychee can scan Markdown / MDX files |
| 30 | + - name: Checkout repo |
| 31 | + uses: actions/checkout@v4 |
50 | 32 |
|
51 | | - # TODO: Re-enable main docs checking later |
52 | | - # - name: Check main docs links |
53 | | - # id: lychee-main |
54 | | - # uses: lycheeverse/lychee-action@v2 |
55 | | - # env: |
56 | | - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
57 | | - # with: |
58 | | - # args: > |
59 | | - # --verbose |
60 | | - # --no-progress |
61 | | - # --base-url ${{ inputs.base_url || 'https://auth0.com' }} |
62 | | - # --accept 200..=299,302,429 |
63 | | - # --exclude-path '../LICENSE' |
64 | | - # main/**/*.md |
65 | | - # main/**/*.mdx |
| 33 | + # Run Lychee on the Auth0 for AI Agents Mintlify content |
| 34 | + # |
| 35 | + # Notes on args: |
| 36 | + # - --scheme https |
| 37 | + # Only check HTTPS links. Other schemes (mailto:, file:, etc) are skipped. |
| 38 | + # - --accept 200..=299,302,429 |
| 39 | + # Treat 2xx, 302, and 429 as success. 302 is common for docs redirects, |
| 40 | + # 429 is rate limiting that we do not want to treat as "broken". |
| 41 | + # - --exclude-path '.vale' |
| 42 | + # Skip the .vale directory used for prose linting. |
| 43 | + # - auth4genai/**/*.md / .mdx |
| 44 | + # Scope to the Mintlify site for Auth0 for AI Agents. |
| 45 | + # |
| 46 | + # Internal routing, API-only endpoints, and other noisy URLs are |
| 47 | + # filtered via .lycheeignore in the repo root. |
| 48 | + - name: Run Lychee on auth4genai docs |
| 49 | + id: lychee-auth4genai |
| 50 | + uses: lycheeverse/lychee-action@v2 |
| 51 | + env: |
| 52 | + # Used by Lychee for authenticated GitHub requests to reduce rate limiting. |
| 53 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 54 | + with: |
| 55 | + args: > |
| 56 | + --verbose |
| 57 | + --no-progress |
| 58 | + --scheme https |
| 59 | + --accept 200..=299,302,429 |
| 60 | + --exclude-path '.vale' |
| 61 | + auth4genai/**/*.md |
| 62 | + auth4genai/**/*.mdx |
66 | 63 |
|
67 | | - - name: Check auth4genai docs links |
68 | | - id: lychee-auth4genai |
69 | | - uses: lycheeverse/lychee-action@v2 |
70 | | - env: |
71 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
72 | | - with: |
73 | | - args: > |
74 | | - --verbose |
75 | | - --no-progress |
76 | | - --base-url https://auth0.com/ai/docs |
77 | | - --remap 'https://auth0.com/(?!docs/|ai/) https://auth0.com/ai/docs/' |
78 | | - --accept 200..=299,302,429 |
79 | | - --exclude-path '.vale' |
80 | | - auth4genai/**/*.md |
81 | | - auth4genai/**/*.mdx |
82 | | - # Auth4GenAI docs: Remap auth0.com/* paths to auth0.com/ai/docs/* |
83 | | - # (except paths already starting with /docs/ or /ai/) |
84 | | - # Accept 429 to handle rate limiting on auth0.com |
| 64 | + # Optional: example of how you might later add main docs checking. |
| 65 | + # Uncomment and adjust when you want to bring main/ back into scope. |
| 66 | + # |
| 67 | + # - name: Run Lychee on main docs |
| 68 | + # id: lychee-main |
| 69 | + # uses: lycheeverse/lychee-action@v2 |
| 70 | + # env: |
| 71 | + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 72 | + # with: |
| 73 | + # args: > |
| 74 | + # --verbose |
| 75 | + # --no-progress |
| 76 | + # --scheme https |
| 77 | + # --accept 200..=299,302,429 |
| 78 | + # main/**/*.md |
| 79 | + # main/**/*.mdx |
85 | 80 |
|
86 | | - # For now this only warns so it does not block merges while you tune ignores. |
87 | | - # Once the noise is under control, delete this step so Lychee failures break CI. |
88 | | - - name: Warn on failures instead of failing CI |
89 | | - if: steps.lychee-auth4genai.outputs.exit_code != 0 |
90 | | - run: | |
91 | | - echo "Lychee found broken links." |
92 | | - echo "Auth4GenAI docs exit code: ${{ steps.lychee-auth4genai.outputs.exit_code }}" |
93 | | - echo "Check the Lychee step logs above for details." |
94 | | - exit 0 |
| 81 | + # For now, only warn on failures so you can tune .lycheeignore and fix |
| 82 | + # obvious issues without blocking merges. |
| 83 | + # |
| 84 | + # Once you are happy with the signal/noise ratio, delete this step so that |
| 85 | + # Lychee's non-zero exit code will fail the job. |
| 86 | + - name: Warn on failures instead of failing CI |
| 87 | + if: steps.lychee-auth4genai.outputs.exit_code != 0 |
| 88 | + run: | |
| 89 | + echo "Lychee found broken links in auth4genai docs." |
| 90 | + echo "Auth4GenAI docs exit code: ${{ steps.lychee-auth4genai.outputs.exit_code }}" |
| 91 | + echo "Check the Lychee step logs above for details." |
| 92 | + exit 0 |
0 commit comments