Skip to content

Commit

Permalink
Update lychee to try and avoid rate-limiting
Browse files Browse the repository at this point in the history
- To avoid rate-limiting, update to v2 in actions and set max-retries | max-concurrency | cache in both the local installation and the Action. Tested with version 0.18.0 locally, which removed the rate-limiting 429 response from learn.microsoft.com
  • Loading branch information
bparks13 committed Jan 7, 2025
1 parent f2b00f2 commit 2013da3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,20 @@ jobs:
with:
name: _site
path: _site


- name: Restore lychee cache
uses: actions/cache@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-

# This checks for missing / broken links in the *.html files after building the website.
# We need to run this step here to check that all auto-generated API pages have valid links too.
- name: Check HTML Links After Building
uses: lycheeverse/lychee-action@v1.10.0
uses: lycheeverse/lychee-action@v2
with:
args: --verbose --no-progress --base _site --exclude ^https://github\.com.*merge.* --exclude ^https://github\.com.*apiSpec.* '_site/**/*.html' --accept 429
args: --verbose --no-progress --base _site --exclude ^https://github\.com.*merge.* --exclude ^https://github\.com.*apiSpec.* '_site/**/*.html --max-retries 0 --max-concurrency 32 --cache --max-cache-age 1d'
fail: true

deploy:
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ _*/
*.exe
*.exe.old
*.exe.settings
Packages
Packages

## Lychee cache
.lycheecache
2 changes: 1 addition & 1 deletion docfx-utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function lychee($lycheePath)
{
Write-Output "`nRunning lychee..."
Write-Output "------------------------------------------`n"
Invoke-Expression "& `"$lycheePath`" --no-progress --base _site --exclude ^https://github\.com.*merge.* --exclude ^https://github\.com.*apiSpec.* --exclude ^https://github\.com/open-ephys/onix1-bonsai-docs/blob/.*/#L1 '_site/**/*.html' --accept 429"
Invoke-Expression "& `"$lycheePath`" --no-progress --base _site --exclude ^https://github\.com.*merge.* --exclude ^https://github\.com.*apiSpec.* --exclude ^https://github\.com/open-ephys/onix1-bonsai-docs/blob/.*/#L1 '_site/**/*.html' --max-retries 0 --max-concurrency 32 --cache --max-cache-age 1d"
Write-Output "`n"
}

Expand Down

0 comments on commit 2013da3

Please sign in to comment.