Skip to content

Commit

Permalink
Cache successful requests in lychee (#6030)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dmathieu authored Dec 11, 2024
1 parent ac386f3 commit 58fdf2a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/links-fail-fast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
- uses: actions/checkout@v4

- name: Restore lychee cache
uses: actions/cache@v4
uses: actions/cache/restore@v4
id: cache-restore
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
Expand All @@ -25,4 +26,11 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fail: true
args: --max-concurrency 5 --cache --max-cache-age 1d .
args: --max-concurrency 5 --cache --max-cache-age 1d --cache-exclude-status 300..=599 .

- name: Save lychee cache
if: always()
uses: actions/cache/save@v4
with:
path: .lycheecache
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
12 changes: 10 additions & 2 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:


- name: Restore lychee cache
uses: actions/cache@v4
uses: actions/cache/restore@v4
id: cache-restore
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
Expand All @@ -30,7 +31,14 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: --max-concurrency 1 --cache --max-cache-age 1d .
args: --max-concurrency 1 --cache --max-cache-age 1d --cache-exclude-status 300..=599 .

- name: Save lychee cache
if: always()
uses: actions/cache/save@v4
with:
path: .lycheecache
key: ${{ steps.cache-restore.outputs.cache-primary-key }}

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

0 comments on commit 58fdf2a

Please sign in to comment.