Skip to content
Open
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
51 changes: 34 additions & 17 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ on:
schedule:
# https://crontab.guru/#00_18_*_*_1
- cron: "00 18 * * 1"
pull_request:

permissions:
issues: write

jobs:
linkChecker:
linkcheck-pr:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -25,22 +27,37 @@ jobs:
- name: Build
run: hugo --minify

- name: Link Checker
uses: lycheeverse/lychee-action@v2.0.2
# Intentionally skips (req for full deploy parity) to keep
# PR checks fast and network-light.
- name: Generate blog post redirects
run: python scripts/generate-blog-aliases.py

- name: Link Checker (internal, offline)
uses: lycheeverse/lychee-action@v2.7.0
with:
args: --offline --no-progress --root-dir "${{ github.workspace }}/public" --exclude '^file://.*/public/roadmap/?$' public/**/*.html

@Haleshot Haleshot Apr 21, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hesitated a bit over hardcoding this but I feel it makes sense. /roadmap is intentionally served from the separate roadmap repo rather than from this site build (as noted here). This exclude is only here to stop the PR check from treating it as a missing local file.


linkcheck-scheduled:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.125.3'
extended: true

- name: Build
run: hugo --minify

- name: Generate blog post redirects
run: python scripts/generate-blog-aliases.py

- name: Link Checker (external)
uses: lycheeverse/lychee-action@v2.7.0
with:
args: |
# fonts.gstatic.com is an expected fail
--exclude https://fonts.gstatic.com
# "%oo many requests" errors
--exclude twitter.com
# 403 Forbidden errors
--exclude https://data8.org
# 403 Forbidden errors
--exclude https://biorxiv.org
--exclude https://www.biorxiv.org
--verbose
--no-progress
public/**/*.html
args: --verbose --no-progress --root-dir "${{ github.workspace }}/public" public/**/*.html
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

Expand All @@ -50,4 +67,4 @@ jobs:
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue
labels: report, automated issue
9 changes: 9 additions & 0 deletions lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
exclude = [
"https://fonts.gstatic.com", # expected connectivity failure
"twitter.com",
"https://data8.org",
"https://biorxiv.org",
"https://www.biorxiv.org",
]

max_concurrency = 50
2 changes: 0 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ def linkcheck(session):
"--offline",
"--accept",
"200,301,302",
"--max-concurrency",
"50",
"public",
external=True,
)
Expand Down
Loading