Skip to content

docs(readme): point CI badges at per-branch shim + repair husky hook #351

docs(readme): point CI badges at per-branch shim + repair husky hook

docs(readme): point CI badges at per-branch shim + repair husky hook #351

Workflow file for this run

---
name: Check Links
on:
push:
branches: [main]
paths:
- "**.md"
- "docs/**"
- ".github/workflows/check-links.yml"
- ".lycheeignore"
pull_request:
branches: [main]
paths:
- "**.md"
- "docs/**"
schedule:
# Run weekly on Mondays at 9 AM UTC to catch dead external links
- cron: "0 9 * * 1"
workflow_dispatch:
jobs:
check-internal-links:
name: Check Internal Markdown Links
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Restore lychee cache
uses: actions/cache@v5
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- name: Check internal links with lychee
uses: lycheeverse/lychee-action@v2
with:
# Only check internal links (file:// scheme)
args: >-
--verbose
--no-progress
--cache
--max-cache-age 1d
--scheme file
--include-fragments
--exclude-path node_modules
--exclude-path .git
'**/*.md'
format: markdown
output: lychee-internal.md
fail: true
jobSummary: true
- name: Upload internal link report
if: always()
uses: actions/upload-artifact@v7
with:
name: lychee-internal-report
path: lychee-internal.md
retention-days: 7
check-external-links:
name: Check External URLs
runs-on: ubuntu-latest
# Only run on schedule or manual trigger to avoid rate limits
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Restore lychee cache
uses: actions/cache@v5
with:
path: .lycheecache
key: cache-lychee-external-${{ github.sha }}
restore-keys: cache-lychee-external-
- name: Check external links with lychee
uses: lycheeverse/lychee-action@v2
with:
# Only check external links (http/https schemes)
args: >-
--verbose
--no-progress
--cache
--max-cache-age 1d
--scheme https
--scheme http
--exclude-path node_modules
--exclude-path .git
--exclude '^http://localhost'
--exclude '^https://localhost'
--timeout 20
--max-concurrency 10
--accept 200,206,301,302,307,308,429,999
--header 'accept=*/*'
'**/*.md'
format: markdown
output: lychee-external.md
fail: false
jobSummary: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload external link report
if: always()
uses: actions/upload-artifact@v7
with:
name: lychee-external-report
path: lychee-external.md
retention-days: 30
link-check-summary:
name: Link Check Summary
runs-on: ubuntu-latest
needs: [check-internal-links, check-external-links]
if: always()
steps:
- name: Summary
run: |
echo "## Link Check Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [[ "${{ needs.check-internal-links.result }}" == "success" ]]; then
echo "✅ Internal links: PASSED" >> $GITHUB_STEP_SUMMARY
else
echo "❌ Internal links: FAILED" >> $GITHUB_STEP_SUMMARY
fi
if [[ "${{ needs.check-external-links.result }}" == "success" ]]; then
echo "✅ External URLs: PASSED" >> $GITHUB_STEP_SUMMARY
elif [[ "${{ needs.check-external-links.result }}" == "skipped" ]]; then
echo "⏭️ External URLs: SKIPPED (only runs on schedule)" >> $GITHUB_STEP_SUMMARY
else
echo "⚠️ External URLs: COMPLETED WITH WARNINGS" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "📄 Check uploaded artifacts for detailed reports" >> $GITHUB_STEP_SUMMARY