Help us improve
Share bugs, ideas, or general feedback.
From lychee
This skill should be used when the user asks to "create GitHub workflow for lychee", "set up link checking in CI", "automate link validation", "add link check to PR", or "schedule link checking" in GitHub Actions.
npx claudepluginhub tarqd/skills --plugin lycheeHow this skill is triggered — by the user, by Claude, or both
Slash command
/lychee:lychee-github-workflowsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Automate link checking using GitHub Actions with lychee. Create workflows for pull request validation and scheduled checks to catch broken links before they reach production.
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
Automate link checking using GitHub Actions with lychee. Create workflows for pull request validation and scheduled checks to catch broken links before they reach production.
Check links in pull requests before merging:
Benefits:
Use lycheeverse/lychee-action for GitHub Actions integration.
Periodically check links on main branch:
Benefits:
Create .github/workflows/pr-linkcheck.yml:
name: PR Link Check
on:
pull_request:
branches:
- main
jobs:
linkcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch
uses: actions/checkout@v5
- name: Restore lychee cache
uses: actions/cache@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- name: Link Check
uses: lycheeverse/lychee-action@v2
with:
args: --config lychee.toml --cache '**/*.md' '**/*.html'
output: .lychee.report.md
- name: Comment Broken Links
uses: marocchino/sticky-pull-request-comment@v2
if: failure()
with:
path: .lychee.report.md
Key features:
See examples/pr-linkcheck.yml for complete workflow.
Create .github/workflows/scheduled-linkcheck.yml:
name: Scheduled Link Check
on:
schedule:
- cron: "0 18 * * *" # Daily at 6 PM UTC
workflow_dispatch: # Allow manual triggers
jobs:
linkcheck:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Checkout main branch
uses: actions/checkout@v5
- name: Restore lychee cache
uses: actions/cache@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- name: Link Check
id: lychee
uses: lycheeverse/lychee-action@v2
with:
args: --config lychee.toml --cache '**/*.md'
fail: false
output: .lychee.report.md
- name: Create Issue
if: steps.lychee.outputs.exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
content-filepath: .lychee.report.md
labels: report, automated issue
Key features:
workflow_dispatchfail: false)See examples/scheduled-linkcheck.yml for complete workflow.
- uses: lycheeverse/lychee-action@v2
with:
args: '--config lychee.toml --cache docs/'
output: report.md
fail: true
- uses: lycheeverse/lychee-action@v2
with:
# Arguments passed to lychee
args: |
--config lychee.toml
--cache
--max-concurrency 10
--exclude 'example\.com'
'**/*.md'
# Output file for report
output: .lychee.report.md
# Fail workflow on broken links
fail: true
# GitHub token for API access
token: ${{ secrets.GITHUB_TOKEN }}
# Lychee version (default: latest)
version: latest
Cache lychee results to speed up checks and reduce server load:
- name: Restore lychee cache
uses: actions/cache@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: |
cache-lychee-${{ github.ref }}
cache-lychee-
Cache key strategies:
cache-lychee-${{ github.sha }}cache-lychee-${{ github.ref }}cache-lychee-Recommendation: Use global cache with restore-keys for balance between speed and freshness.
Check only files modified in PR:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
**/*.md
**/*.html
- name: Link Check Changed Files
if: steps.changed-files.outputs.any_changed == 'true'
uses: lycheeverse/lychee-action@v2
with:
args: --cache ${{ steps.changed-files.outputs.all_changed_files }}
Benefits: Faster PR checks, only validate what changed.
For projects that generate documentation:
- name: Build documentation
run: |
npm run build
# or: mdbook build
# or: mkdocs build
- name: Link Check Built Site
uses: lycheeverse/lychee-action@v2
with:
args: |
--config lychee.toml
--root-dir $(pwd)/dist
--base-url https://example.com
--cache
dist/
Use case: Check generated HTML after build process.
Test against multiple configurations:
strategy:
matrix:
config: [lenient.toml, strict.toml]
jobs:
linkcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: lycheeverse/lychee-action@v2
with:
args: --config ${{ matrix.config }} docs/
Use case: Different strictness levels for different branches.
Avoid rate limiting on GitHub URLs:
- name: Link Check
uses: lycheeverse/lychee-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --cache docs/
Automatic: lychee-action sets GITHUB_TOKEN by default.
Pass custom environment variables:
- name: Link Check
uses: lycheeverse/lychee-action@v2
env:
CUSTOM_VAR: value
with:
args: --cache docs/
on:
pull_request:
branches: [main, develop]
paths:
- '**/*.md'
- '**/*.html'
- 'lychee.toml'
Optimization: Only trigger on relevant file changes.
on:
push:
branches: [main]
on:
schedule:
- cron: '0 0 * * 0' # Weekly on Sunday at midnight
- cron: '0 18 * * *' # Daily at 6 PM UTC
Cron syntax: minute hour day month weekday
on:
workflow_dispatch:
inputs:
target:
description: 'Directory to check'
required: false
default: 'docs/'
Usage: Run workflow manually from GitHub Actions tab.
on:
pull_request:
branches: [main]
schedule:
- cron: '0 18 * * *'
workflow_dispatch:
Post results as PR comment:
- name: Comment Results
uses: marocchino/sticky-pull-request-comment@v2
if: always() # Comment even if check passes
with:
path: .lychee.report.md
header: link-check-report
header parameter: Updates existing comment instead of creating new ones.
Create issue for broken links:
- name: Create Issue
if: steps.lychee.outputs.exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: 'Broken Links Found - ${{ github.run_id }}'
content-filepath: .lychee.report.md
labels: bug, documentation, automated
assignees: '@username'
Save report as workflow artifact:
- name: Upload Report
if: always()
uses: actions/upload-artifact@v4
with:
name: lychee-report
path: .lychee.report.md
MkDocs:
- run: mkdocs build
- uses: lycheeverse/lychee-action@v2
with:
args: --root-dir $(pwd)/site site/
mdBook:
- run: mdbook build
- uses: lycheeverse/lychee-action@v2
with:
args: --root-dir $(pwd)/book book/
Docusaurus:
- run: npm run build
- uses: lycheeverse/lychee-action@v2
with:
args: --root-dir $(pwd)/build build/
Check locally built site with production URL references:
- name: Build site
run: npm run build
- name: Link Check with Remap
uses: lycheeverse/lychee-action@v2
with:
args: |
--root-dir $(pwd)/dist
--remap 'https://example.com file://$(pwd)/dist'
--cache
dist/
Solution: Use caching and GitHub token:
- uses: lycheeverse/lychee-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --cache --accept '200..=299,429' docs/
Solution: Ensure cache path matches lychee cache location:
with:
path: .lycheecache # Must match lychee's cache directory
Solutions:
--max-concurrency 10--max-cache-age 7dSolution: Configure exclusions in lychee.toml:
exclude = [
"https://example\\.com",
"localhost"
]
Complete workflow examples in examples/:
examples/pr-linkcheck.yml - PR link check with PR commentsexamples/scheduled-linkcheck.yml - Scheduled checks with issue creationexamples/mdbook-workflow.yml - Complete mdBook project workflowlychee.toml configuration file