Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
31 changes: 31 additions & 0 deletions .github/lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
scheme = ["http", "https"]
include_fragments = "anchor-only"
exclude_all_private = true
max_retries = 3
timeout = 30
host_concurrency = 4
accept = ["200..=299", "403", "429"]

extensions = ["cff", "html", "ipynb", "md", "py", "rst", "toml", "yaml", "yml"]
hidden = true

exclude_path = [
"(^|/)\\.git/",
"(^|/)docs/_build/",
"(^|/)\\.github/lychee\\.toml$",
"(^|/)docs/conf\\.py$",
]

remap = [
'^(https://github\.com/[^#]*)#.*$ $1',
]

exclude = [
'^https?://(www\.)?example\.(com|org)',
'^https://api\.github\.com/',
'/n$',
'\\n$',
'%7B',
'/%s$',
'^https://(www\.)?linkedin\.com/',
]
40 changes: 40 additions & 0 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Link Check

on:
schedule:
- cron: "0 3 1 * *"
workflow_dispatch:
pull_request:
paths:
- .github/workflows/linkcheck.yml
- .github/lychee.toml

permissions:
contents: read

jobs:
linkcheck:
if: github.repository_owner == 'casact'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803
with:
persist-credentials: false

- name: Check links
id: lychee
uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8
with:
args: >-
--config .github/lychee.toml --no-progress
--root-dir "${{ github.workspace }}" .
fail: false
jobSummary: true

- name: Fail on lychee errors
if: steps.lychee.outputs.exit_code != 0 && steps.lychee.outputs.exit_code != 2
run: |
echo "::error::lychee exited with code $EXIT_CODE"
exit 1
env:
EXIT_CODE: ${{ steps.lychee.outputs.exit_code }}
Loading