Skip to content

Commit 7ec747e

Browse files
committed
ci: use lychee for link checking
1 parent 09e4176 commit 7ec747e

4 files changed

Lines changed: 60 additions & 25 deletions

File tree

.github/workflows/url-check-config.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/url-check-on-change.yml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,37 @@ on:
55
branches: [main]
66
pull_request:
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
permissions: {}
13+
814
jobs:
915
markdown-link-check:
1016
runs-on: ubuntu-latest
1117
steps:
12-
- uses: actions/checkout@v4
13-
- uses: gaurav-nelson/github-action-markdown-link-check@v1
14-
with:
15-
use-verbose-mode: 'yes'
16-
use-quiet-mode: 'yes'
17-
config-file: '.github/workflows/url-check-config.json'
18-
check-modified-files-only: 'yes'
19-
base-branch: 'main'
18+
- name: Checkout repository
19+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
20+
with:
21+
persist-credentials: false
22+
23+
- name: Restore lychee cache
24+
uses: actions/cache@v4
25+
with:
26+
path: .lycheecache
27+
key: cache-lychee-${{ github.sha }}
28+
restore-keys: cache-lychee-
29+
30+
- name: Link Checker
31+
uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2.7.0
32+
env:
33+
# set the GitHub token to avoid rate limits
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
with:
36+
fail: true
37+
args: |
38+
--no-progress
39+
--include-fragments
40+
--accept '100..=103, 200..=299, 429'
41+
.

.github/workflows/url-check-periodic.yml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,36 @@ name: Check Markdown links Periodically
22

33
on:
44
schedule:
5-
# Run everyday at 0:00 AM
6-
- cron: "0 0 * * *"
5+
# Run everyday at 0:00 AM
6+
- cron: "0 0 * * *"
7+
8+
permissions: {}
79

810
jobs:
9-
markdown-link-check:
11+
markdown-link-check-periodic:
1012
runs-on: ubuntu-latest
1113
steps:
12-
- uses: actions/checkout@v4
13-
- uses: gaurav-nelson/github-action-markdown-link-check@v1
14-
with:
15-
use-verbose-mode: 'yes'
16-
use-quiet-mode: 'yes'
17-
config-file: '.github/workflows/url-check-config.json'
18-
base-branch: 'main'
14+
- name: Checkout repository
15+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
16+
with:
17+
persist-credentials: false
18+
19+
- name: Restore lychee cache
20+
uses: actions/cache@v4
21+
with:
22+
path: .lycheecache
23+
key: cache-lychee-${{ github.sha }}
24+
restore-keys: cache-lychee-
25+
26+
- name: Link Checker
27+
uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2.7.0
28+
env:
29+
# set the GitHub token to avoid rate limits
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
with:
32+
fail: true
33+
args: |
34+
--no-progress
35+
--include-fragments
36+
--accept '100..=103, 200..=299, 429'
37+
.

.lycheeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
^(http|https)://crates.io/

0 commit comments

Comments
 (0)