Skip to content

Commit f91587c

Browse files
brabojclaude
andcommitted
fix: configure lychee link checker for Astro base path (#121)
Add lychee.toml with remap rule to strip /tutorial-git/ prefix, re-enable link checking in both build and deploy workflows. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d78535d commit f91587c

3 files changed

Lines changed: 33 additions & 12 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ jobs:
3030
working-directory: astro-site
3131
run: npm run build
3232

33-
# TODO: Fix lychee configuration for Astro's base path and fragment links (#121)
34-
# - name: Check links
35-
# uses: lycheeverse/lychee-action@v2
36-
# with:
37-
# args: --base ${{ github.workspace }}/astro-site/dist --root-dir ${{ github.workspace }}/astro-site/dist astro-site/dist
38-
# fail: true
33+
- name: Check links
34+
uses: lycheeverse/lychee-action@v2
35+
with:
36+
args: --base astro-site/dist --config lychee.toml 'astro-site/dist/**/*.html'
37+
fail: true

.github/workflows/deploy.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,11 @@ jobs:
3939
working-directory: astro-site
4040
run: npm run build
4141

42-
# TODO: Fix lychee configuration for Astro's base path and fragment links (#121)
43-
# - name: Check links
44-
# uses: lycheeverse/lychee-action@v2
45-
# with:
46-
# args: --base ${{ github.workspace }}/astro-site/dist --root-dir ${{ github.workspace }}/astro-site/dist astro-site/dist
47-
# fail: true
42+
- name: Check links
43+
uses: lycheeverse/lychee-action@v2
44+
with:
45+
args: --base astro-site/dist --config lychee.toml 'astro-site/dist/**/*.html'
46+
fail: true
4847

4948
- name: Upload artifact
5049
uses: actions/upload-pages-artifact@v3

lychee.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Lychee link checker configuration
2+
# Runs against the Astro build output in astro-site/dist/
3+
4+
# Remap the /tutorial-git/ base path to the dist root so that
5+
# root-relative links like /tutorial-git/introduction/ resolve
6+
# to dist/introduction/index.html
7+
remap = ["/tutorial-git/(.*) file:///$1"]
8+
9+
# Skip external links in CI to avoid flaky failures from transient
10+
# network issues. Run with --include-mail to check mailto: links.
11+
exclude_path = []
12+
13+
# Exclude external URLs to keep CI fast and deterministic
14+
exclude = [
15+
"^https://",
16+
"^http://",
17+
]
18+
19+
# Accept 200 and 204
20+
accept = [200, 204]
21+
22+
# No caching needed in CI
23+
no_progress = true

0 commit comments

Comments
 (0)