feat: add lychee.toml and lycheecache support

Signed-off-by: Rui Chen <rui@chenrui.dev>
This commit is contained in:
Rui Chen
2025-10-27 15:05:50 -04:00
parent b7cd95e97b
commit fe7141c7d8
3 changed files with 36 additions and 0 deletions

View File

@@ -7,5 +7,15 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: Restore lychee cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- name: Link Checker
uses: lycheeverse/lychee-action@885c65f3dc543b57c898c8099f4e08c8afd178a2 # v2
with:
args: --config ./lychee.toml README.md

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
# Lychee link checker cache
.lycheecache

24
lychee.toml Normal file
View File

@@ -0,0 +1,24 @@
# Lychee link checker configuration
# Maximum number of retries per link
max_retries = 3
# Wait time between retries (in seconds)
retry_wait_time = 5
# Maximum number of concurrent network requests
max_concurrency = 10
# Accept 429 status codes (rate limiting) as valid after retries
# This prevents CI failures due to temporary rate limits
accept = [200, 204, 206, 429]
# Alternative: Exclude hashicorp.com if rate limiting persists
# Uncomment the line below if you want to skip hashicorp.com checks entirely
# exclude = ['https://www\.hashicorp\.com/.*']
# Cache results to avoid repeated checks
cache = true
# Use a custom user agent to be more identifiable
user_agent = "awesome-tf link checker (https://github.com/shuaibiyy/awesome-tf)"