From ed9fc7749d95e5964540da35202c0dbd578facb2 Mon Sep 17 00:00:00 2001 From: void <1711810+taraxvoid@users.noreply.github.com> Date: Tue, 6 Oct 2026 12:41:04 -0700 Subject: [PATCH] docs: make lefthook prepare script tolerate a missing binary in CI Co-Authored-By: Claude Sonnet 5.5 --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5dccc88..b2f2904 100644 --- a/README.md +++ b/README.md @@ -222,8 +222,17 @@ scripts: define `test:unit:precommit` (for example excluding tests that need a built `dist/`) and the pre-commit unit step runs it instead of `test:unit`. Install the binary through mise (`lefthook = ""` in `mise.toml`) and -set `"prepare": "lefthook install"` so `bun install` wires the hooks. `ref` -cannot be a commit SHA; pin a release tag. +set the `prepare` script so `bun install` wires the hooks, but make it tolerate a +missing binary: + +```json +"prepare": "lefthook install || echo 'lefthook not installed (run mise install); git hooks skipped'" +``` + +A bare `lefthook install` fails the whole install step (exit 127) on any runner +without the `lefthook` binary, which includes GitHub-hosted and self-hosted CI +images, and CI never runs git hooks anyway. `ref` cannot be a commit SHA; pin a +release tag. ## Branch rulesets as code