Skip to content

Commit f138b28

Browse files
committed
Update link checker config
1 parent fafaddd commit f138b28

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

.github/workflows/link-fail-fast.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
linkChecker:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v4
10+
- uses: actions/checkout@v6
1111
with:
1212
fetch-depth: 2
1313

@@ -17,12 +17,19 @@ jobs:
1717
CHANGED_FILES=$(git diff-tree --name-only --diff-filter 'AM' -r HEAD^1 HEAD -- "*.md" | sed -z "s/\n$//;s/\n/' '/g")
1818
echo "all_changed_files=${CHANGED_FILES}" >> $GITHUB_OUTPUT
1919
20+
- name: Restore lychee cache
21+
uses: actions/cache@v4
22+
with:
23+
path: .lycheecache
24+
key: cache-lychee-${{ github.sha }}
25+
restore-keys: cache-lychee-
26+
2027
- name: Link Checker
2128
if: ${{ steps.changed-files.outputs.all_changed_files }}
22-
uses: lycheeverse/lychee-action@v2.3.0
29+
uses: lycheeverse/lychee-action@v2
2330
with:
2431
fail: true
2532
failIfEmpty: false
26-
args: --root-dir $(pwd) -E -i -n -t 45 -- '${{ steps.changed-files.outputs.all_changed_files }}'
33+
args: --root-dir $(pwd) --cache --max-cache-age 1d -E -i -n -t 45 -- '${{ steps.changed-files.outputs.all_changed_files }}'
2734
env:
2835
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/link.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,34 @@ jobs:
1111
if: github.repository == 'pingcap/docs'
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v6
1515

1616
- name: Download Exclude Path
1717
run: |
1818
curl https://raw.githubusercontent.com/pingcap/docs/master/.lycheeignore --output .lycheeignore
1919
20+
- name: Restore lychee cache
21+
uses: actions/cache@v4
22+
with:
23+
path: .lycheecache
24+
key: cache-lychee-${{ github.sha }}
25+
restore-keys: cache-lychee-
26+
2027
- name: Check Links
21-
uses: lycheeverse/lychee-action@v1.6.1
28+
uses: lycheeverse/lychee-action@v2
2229
with:
2330
# For parameter description, see https://github.com/lycheeverse/lychee#commandline-parameters
2431
# Accept 429 for now due to github rate limit.
2532
# See https://github.com/lycheeverse/lychee/issues/634
26-
args: -E --exclude-mail -i -n -t 45 -- **/*.md *.md
33+
fail: true
34+
failIfEmpty: false
35+
args: --root-dir $(pwd) --cache --max-cache-age 8d -E -i -n -t 45 --exclude-path '^releases/' -- **/*.md *.md
2736
output: out.md
2837
env:
2938
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
3039

3140
- name: Create Issue From File
32-
uses: peter-evans/create-issue-from-file@v4
41+
uses: peter-evans/create-issue-from-file@v6
3342
with:
3443
title: Broken Link Detected
3544
content-filepath: out.md

0 commit comments

Comments
 (0)