Repository navigation
ci(prek): run lychee from a pinned prebuilt release in CI - #2187
Merged
Merged
Conversation
actions/cache tars each matched path whole and applies an exclusion only to paths the glob matched on its own. With the bare `~/.cache/prek` directory listed, `!~/.cache/prek/cache` matched nothing, so prek's download caches stayed in the archive. Listing the directory's entries (`~/.cache/prek/*`) lets the exclusion drop `cache`. Found by the pre-PR adversarial review. Generated-by: Claude Opus 5
The lychee hook is `language: rust`, so CI had prek `cargo install` it: a multi-minute compile on ubuntu-slim's single vCPU, and the largest part of the hook-environment cache the job restores on every run (apache#2175). CI now downloads lychee 0.24.2's static musl release, checks it against the SHA-256 GitHub reports for the asset, and runs it with the hook's own arguments. No new action is involved. Since CI no longer runs the hook, prek builds no Rust environment there; the cache key moves to a `v3` prefix so restore-keys stops carrying the old one forward. Contributors still run the hook locally through prek; both places note that the arguments must stay in step. Generated-by: Claude Opus 5
potiuk
force-pushed
the
ci/lychee-prebuilt
branch
from
November 18, 2026 04:58
db09312 to
7ae681f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #2185, which merged from its first commit only. This PR also carries that PR's second commit, the cache-path fix below.
The lychee hook is
language: rust, so CI had prekcargo installlychee: a multi-minute compile onubuntu-slim's single vCPU, and the largest part of the hook-environment cache every run restores (#2175).~/.cache/preklisted,!~/.cache/prek/cachematches nothing and prek's download caches stay in the archive. The path is now~/.cache/prek/*.PATH, and the link-check step runslychee --config .lychee.toml --no-progress ., the hook's own arguments. No new action is involved, so nothing new needs the ASF action allowlist.Run prekstep already skipslychee, and the dedicated step no longer goes through prek, so prek never builds the Rust env on the runner.prek cache gckeeps the envs of every hook the config names, so under the previous prefixrestore-keyswould carry the old Rust env forward indefinitely. The key moves from ci(prek): keep the hook-environment cache small enough for ubuntu-slim #2185'sprek-v2-toprek-v3-, which costs one more cold build of the remaining envs.Type of change
prek, workflows, validators)Test plan
prek runon the changed files andzizmorpass (no findings)lychee-x86_64-unknown-linux-musl.tar.gz(v0.24.2)lychee 0.24.2, and the link check passesNotes for reviewers (optional)
A version bump is now a two-line change (
LYCHEE_VERSION,LYCHEE_SHA256), and the local hook, being unpinnedcli:lychee, can run a newer lychee than CI.Pinning the hook to the same version would keep them aligned; left out here to keep this PR to CI.
Linked issues
Refs #2175
🤖 Generated with Claude Code