Skip to content

Commit 9bc1f12

Browse files
committed
Simplify workflow: check all links instead of additions
1 parent 4c656ab commit 9bc1f12

File tree

2 files changed

+10
-32
lines changed

2 files changed

+10
-32
lines changed

.github/workflows/check-pr-links.yml

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -24,44 +24,21 @@ jobs:
2424
with:
2525
version: latest
2626

27-
- name: Check out master branch
28-
run: git checkout master
29-
30-
- name: Install dependencies for master
31-
run: pnpm install --frozen-lockfile
32-
33-
- name: Build site from master
34-
run: pnpm build
35-
36-
- name: Dump all links from master
37-
id: dump_links_from_master
38-
uses: lycheeverse/lychee-action@v2
39-
with:
40-
args: '--dump --root-dir ${{ github.workspace }}/dist --exclude-all-private dist'
41-
output: ./links-master.txt
42-
43-
- name: Stash untracked files
44-
run: git stash push --include-untracked
45-
46-
- name: Check out feature branch
47-
run: git fetch origin ${{ github.ref }} && git checkout FETCH_HEAD
48-
49-
- name: Apply stashed changes
50-
run: git stash pop || true
51-
5227
- name: Install dependencies for feature branch
5328
run: pnpm install --frozen-lockfile
5429

5530
- name: Build site from feature branch
5631
run: pnpm build
5732

58-
- name: Append links-master.txt to .lycheeignore
59-
run: cat links-master.txt >> .lycheeignore
60-
61-
- name: Check links in PR changes
33+
- name: Check links
6234
uses: lycheeverse/lychee-action@v2
6335
with:
64-
args: '--root-dir ${{ github.workspace }}/dist --exclude-all-private dist'
36+
args: |
37+
--root-dir $PWD/dist
38+
--exclude-all-private
39+
--remap 'https://lychee\.cli\.rs/(.*)/ file://'$PWD'/dist/$1/index.html'
40+
--index-files index.html
41+
dist
6542
fail: true
6643

6744
- name: Suggestions

.lycheeignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ https://api.reacher.email/v0/check_email
22
file:///home/user/website/
33
^https://www/$
44
^https://web/$
5-
# 404 page returns a 404, d'oh
6-
https://lychee.cli.rs/404/
75
# Errors with "Too Many Requests"
86
https://www.nongnu.org/atool
7+
8+
# 404 page is directly in dist/404.html but we've remapped it to an invalid path
9+
dist/404/index.html$

0 commit comments

Comments
 (0)