Skip to content

Check Broken Links

Check Broken Links #29

Workflow file for this run

# Workflow to check broken links across the site.
# If you're wondering why I use a workflow instead of integrating it in the 11ty build pipeline,
# it's because I want the flexibility to check links regularly, without having to run build each time.
# If you post and update your blog regularly, then fine by me. But I forsee myself taking a hiatus once
# in a blue moon, and I rather the system alert me rather than me manually checking each week.
name: Check Broken Links
on:
# repository_dispatch:
workflow_dispatch:
schedule:
- cron: "00 11 * * 2,5" # HKT 7PM Tuesday/Friday
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: site
# - name: Restore Lychee Cache
# uses: actions/cache@v3
# with:
# path: .lycheecache
# key: cache-lychee-${{ github.sha }}
# restore-keys: cache-lychee-
- name: Check Links
id: lychee
uses: lycheeverse/lychee-action@v1
with:
args: --base _site --accept 100..=103,200..=299,403,429 --user-agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36' --timeout 60 --no-progress --include-verbatim --include-fragments --exclude-path _site/404.html _site
jobSummary: true
fail: true
# - name: Create Issue From File
# if: env.lychee_exit_code != 0
# uses: peter-evans/create-issue-from-file@v5
# with:
# title: Link Checker Report
# content-filepath: ./lychee/out.md
# labels: report, automated issue