Skip to content

Commit 0f782d1

Browse files
Copilothotlong
andcommitted
Add lychee-action workflow for automated link checking
Created GitHub Action workflow using lychee-action to detect broken links: - check-links.yml: Runs on push to main and on pull requests - Scans content/**/*.{md,mdx}, docs/**/*.{md,mdx}, and README.md - Fails CI if broken links are found - .lycheeignore: Ignores localhost, example.com, and social media links This provides an additional layer of link validation alongside the existing custom validation script. Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 30cdb1b commit 0f782d1

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.github/workflows/check-links.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Check Links
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
check-links:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Check links with Lychee
17+
uses: lycheeverse/lychee-action@v1
18+
with:
19+
# Scan all markdown files in content directories and README
20+
args: |
21+
--verbose
22+
--no-progress
23+
--exclude-path .git
24+
--exclude-path node_modules
25+
'content/**/*.md'
26+
'content/**/*.mdx'
27+
'docs/**/*.md'
28+
'docs/**/*.mdx'
29+
'README.md'
30+
# Fail the action on broken links
31+
fail: true
32+
env:
33+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.lycheeignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Ignore localhost links (development/testing)
2+
http://localhost*
3+
4+
# Ignore example links
5+
https://example.com
6+
7+
# Ignore social media links (anti-scraping measures)
8+
https://twitter.com*
9+
https://x.com*

0 commit comments

Comments
 (0)