feat: add lychee-offline composite action - #4
Conversation
Add .github/actions/lychee-offline: installs a pinned, checksum-verified lychee and runs it with --offline so only local file links and #anchors are checked (no network → deterministic, safe for the required ci-status gate). Inputs: globs, config, exclude, version, sha256. The online external-link check is a separate advisory lane (reusable workflow) added next. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f9604d9945
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| set -euo pipefail | ||
| # --offline skips all network requests, so only local file links and | ||
| # #anchors are checked — fully deterministic. | ||
| args=(--offline --no-progress --config "$CONFIG") |
There was a problem hiding this comment.
Add --include-fragments for anchor checks
With any caller config that does not explicitly set fragment checking, this command only adds --offline; lychee v0.24.2 documents --include-fragments as the flag that enables anchor/fragment validation. That means a repo can introduce broken #section links and this advertised offline link/anchor lane still passes, even though the action description and README promise anchor reference-integrity.
Useful? React with 👍 / 👎.
| args+=(--exclude-path "$e") | ||
| done | ||
| # $GLOBS intentionally word-splits into multiple lychee path args. | ||
| lychee "${args[@]}" $GLOBS |
There was a problem hiding this comment.
Preserve lychee glob patterns instead of shell-expanding them
When a caller repo has at least one one-directory-deep markdown file such as docs/a.md, Bash expands the default **/*.md here before lychee sees it (with Bash's default globstar setting), so lychee receives only the shell matches and skips root-level or deeper markdown files. Since lychee's v0.24.2 inputs support file globs directly, this should split the input without pathname expansion (or use --files-from) so the default really scans all markdown.
Useful? React with 👍 / 👎.
Add .github/actions/lychee-offline: installs a pinned, checksum-verified lychee
and runs it with --offline so only local file links and #anchors are checked
(no network → deterministic, safe for the required ci-status gate). Inputs:
globs, config, exclude, version, sha256. The online external-link check is a
separate advisory lane (reusable workflow) added next.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com