Skip to content

Link Checker

Link Checker #16

Workflow file for this run

name: Link Checker
on:
push:
branches: [main]
paths:
- "content/**"
- "themes/**"
- "layouts/**"
schedule:
# Run weekly on Mondays at 08:00 UTC to catch externally broken links
- cron: "0 8 * * 1"
workflow_dispatch:
jobs:
link-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: "0.155.1"
extended: true
- name: Build site
run: hugo --minify
- name: Check links
uses: lycheeverse/lychee-action@v2
with:
args: >
--root-dir ${{ github.workspace }}/public
--exclude "^https://linkedin\.com"
--exclude "^https://twitter\.com"
--exclude "^https://x\.com"
--exclude "^mailto:"
--exclude "^http://localhost"
--timeout 30
--max-retries 3
--accept 200,206,429
public/**/*.html
fail: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}