Skip to content

Commit

Permalink
init lychee checks
Browse files Browse the repository at this point in the history
  • Loading branch information
leiicamundi committed Apr 25, 2024
1 parent 2585421 commit 250c1b8
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
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)

on:
push:
pull_request:
workflow_dispatch:


jobs:
lint:
name: pre-commit
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/[email protected]
with:
fail: true
args: --base . --cache --max-cache-age 1d . --verbose --no-progress 'docs/**/*.md' 'versioned_docs/**/*.md'

# - 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
12 changes: 12 additions & 0 deletions lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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
# Explicitly exclude some URLs
exclude = [
"^file:",
]

0 comments on commit 250c1b8

Please sign in to comment.