Skip to content

Commit 32ae099

Browse files
authored
ci: add link checks to the docs (#1971)
* ci: add link checks to the docs * updated regex * stop 403s from discord support links
1 parent 500ced0 commit 32ae099

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
3+
name: Check Docs Links
4+
5+
on:
6+
pull_request:
7+
branches:
8+
- '*'
9+
paths:
10+
- 'docs/**'
11+
- 'gen-docs/**'
12+
- '.github/workflows/docs-link-check.yml'
13+
push:
14+
branches:
15+
- develop
16+
paths:
17+
- 'docs/**'
18+
- 'gen-docs/**'
19+
- '.github/workflows/docs-link-check.yml'
20+
schedule:
21+
- cron: '50 7 * * 5'
22+
workflow_dispatch:
23+
24+
permissions:
25+
contents: read
26+
27+
concurrency:
28+
group: docs-link-check-${{ github.ref }}
29+
cancel-in-progress: true
30+
31+
jobs:
32+
link-check:
33+
name: Verify external links in Markdown and MDX
34+
runs-on: ubuntu-24.04
35+
timeout-minutes: 20
36+
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v4
40+
with:
41+
fetch-depth: 0
42+
persist-credentials: false
43+
44+
- name: Run Lychee link checker
45+
uses: lycheeverse/lychee-action@v2
46+
with:
47+
fail: false
48+
args: >-
49+
--verbose
50+
--no-progress
51+
--accept 200..204,300..304,307,308,404,429,999
52+
--include '^(http|https)://.*'
53+
--exclude '^file://'
54+
--exclude '^https?://localhost'
55+
--exclude '^https?://127\.0\.0\.1'
56+
--exclude '^https?://0\.0\.0\.0'
57+
--exclude '^https?://\[\:\:1\]'
58+
--exclude '^https?://\[\:\:\]'
59+
--exclude '^https?://support.discord.com'
60+
'./docs/**/*.md'
61+
'./docs/**/*.mdx'
62+
'./gen-docs/**/*.md'
63+
'./gen-docs/**/*.mdx'
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
67+
- name: Upload Lychee report
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: lychee-report
71+
path: |
72+
lychee/out.md
73+
lychee/results.json
74+
if-no-files-found: ignore

0 commit comments

Comments
 (0)