Skip to content

Commit 58fdf2a

Browse files
authored
Cache successful requests in lychee (#6030)
This does the same as we do in contrib, which is to cache successful requests in lychee, so errors such as 429s have less changes of occurring.
1 parent ac386f3 commit 58fdf2a

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

.github/workflows/links-fail-fast.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ jobs:
1313
- uses: actions/checkout@v4
1414

1515
- name: Restore lychee cache
16-
uses: actions/cache@v4
16+
uses: actions/cache/restore@v4
17+
id: cache-restore
1718
with:
1819
path: .lycheecache
1920
key: cache-lychee-${{ github.sha }}
@@ -25,4 +26,11 @@ jobs:
2526
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2627
with:
2728
fail: true
28-
args: --max-concurrency 5 --cache --max-cache-age 1d .
29+
args: --max-concurrency 5 --cache --max-cache-age 1d --cache-exclude-status 300..=599 .
30+
31+
- name: Save lychee cache
32+
if: always()
33+
uses: actions/cache/save@v4
34+
with:
35+
path: .lycheecache
36+
key: ${{ steps.cache-restore.outputs.cache-primary-key }}

.github/workflows/links.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ jobs:
1818

1919

2020
- name: Restore lychee cache
21-
uses: actions/cache@v4
21+
uses: actions/cache/restore@v4
22+
id: cache-restore
2223
with:
2324
path: .lycheecache
2425
key: cache-lychee-${{ github.sha }}
@@ -30,7 +31,14 @@ jobs:
3031
env:
3132
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3233
with:
33-
args: --max-concurrency 1 --cache --max-cache-age 1d .
34+
args: --max-concurrency 1 --cache --max-cache-age 1d --cache-exclude-status 300..=599 .
35+
36+
- name: Save lychee cache
37+
if: always()
38+
uses: actions/cache/save@v4
39+
with:
40+
path: .lycheecache
41+
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
3442

3543
- name: Create Issue From File
3644
if: steps.lychee.outputs.exit_code != 0

0 commit comments

Comments
 (0)