Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(action): check dead links with lychee #3711

Merged
merged 18 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
# desc: lint sanity check
name: Links (Fail Fast)
leiicamundi marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
workflow_dispatch:


leiicamundi marked this conversation as resolved.
Show resolved Hide resolved
jobs:
lint:
name: links-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Restore lychee cache
uses: actions/cache@v3
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-

- name: Link Checker
uses: lycheeverse/lychee-action@v1.9.0
with:
fail: true
args: -c ./lychee.toml --base . --cache --max-cache-age 1d . --verbose --no-progress 'docs/**/*.md' 'versioned_docs/**/*.md'
leiicamundi marked this conversation as resolved.
Show resolved Hide resolved
token: "${{ secrets.GITHUB_TOKEN }}"
leiicamundi marked this conversation as resolved.
Show resolved Hide resolved

# - name: Create Issue From File
# if: env.lychee_exit_code != 0
# uses: peter-evans/create-issue-from-file@v4
# with:
# title: Link Checker Report
# content-filepath: ./lychee/out.md
# labels: report, automated issue
leiicamundi marked this conversation as resolved.
Show resolved Hide resolved
14 changes: 14 additions & 0 deletions lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Cache the results of Lychee if ran locally in order to minimise the chance of rate limiting
cache = true
# Ignore all private link (such as localhost) to avoid errors
exclude_all_private = true
# HTTP status code: 429 (Too Many Requests) will also be treated as a valid link if Lychee gets rate limited
accept = ["200", "429"]
# retry
max_retries = 6
retry_wait_time = 10
max_concurrency = 10
# Explicitly exclude some URLs
exclude = [
"^file:",
]
Loading