Skip to content

Links

Links #187

Workflow file for this run

---
name: Links
on:
pull_request:
paths:
- "**.md"
- "src/data/grip.json"
- "lychee.toml"
- ".github/workflows/links.yml"
schedule:
# Weekly, Mondays at 06:00 UTC — catches link rot over time.
- cron: "0 6 * * 1"
workflow_dispatch:
permissions:
contents: read
jobs:
links:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- name: Check links
id: lychee
uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0
with:
# Config (accept codes, excludes, retries) lives in lychee.toml.
# Inputs: Markdown docs + the mapping data URLs (docsUrl/sourceUrl).
args: >-
--config lychee.toml
--no-progress
'./**/*.md'
'src/data/grip.json'
# Fail the job on broken links for PRs and manual runs. On the
# scheduled run we don't fail; instead we open/append an issue below.
fail: ${{ github.event_name != 'schedule' }}
jobSummary: true
- name: Open issue on scheduled link rot
if: ${{ github.event_name == 'schedule' && steps.lychee.outputs.exit_code != 0 }}
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6.0.0
with:
title: "Broken links detected by the scheduled link checker"
content-filepath: ./lychee/out.md
labels: |-
broken-links
automated