chore: add lefthook git hooks (actionlint, merge-markers, pin-check)#466
Merged
Conversation
Catch locally what the GitHub Actions CI gates reject on push: - pre-commit: actionlint on staged workflow files; merge-conflict marker check - pre-push: pin-check, a mirror of the required CI gate scoped to .github/workflows + actions (same scope as pin-check-ci.yml, so it does not false-positive on skill-markdown examples) Managed by lefthook (already on PATH; no Node/Python runtime). After clone, run: lefthook install Deliberately NOT installed: creep (global no-AI-attribution policy forbids the AI-Tool trailers it stamps), gh-aw compile sync (gh aw not installed and this repo compiles to .lock.yml via scripts/compile-gh-aw.sh), gitleaks (binary not installed locally).
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
Provisioned project-tailored git hooks via lefthook (already on PATH; no Node/Python runtime). The hooks catch locally exactly what this repo's CI gates reject on push.
actionlint.github/workflows/*.yml)actionlintmerge-conflicts<<<<<<</>>>>>>>markerspin-checkuses:refs — mirror of the required CI gatescripts/check-pins.shscripts/check-pins.shmirrors.github/workflows/pin-check.ymlexactly and scans the same dirs aspin-check-ci.yml(.github/workflows+actions) — so it does not false-positive on the illustrativeuses: …@v6lines in.github/skills/**/*.md.Validated live (not just asserted)
merge-conflicts→ passed (actionlint correctly skipped — no workflow files staged).pin-check→ passed ("all action references SHA-pinned", ~2.5s).@v4→ exit 1 with an actionable message.Deliberately NOT installed (with reasons)
git-creepis on PATH, but the globalCLAUDE.mdrule "No AI Attribution: Do NOT add Co-Authored-By or similar AI attribution lines" forbids theAI-Tool/AI-Modeltrailers it stamps.gh awis not installed, and this repo compiles to.lock.ymlviascripts/compile-gh-aw.sh(not the genericgh aw compile → .yml). Worth adding oncegh awis installed.reusable-security.yml).Team setup
After clone:
lefthook install. Bypass in an emergency:git commit --no-verify/git push --no-verify.Type of Change
Test Plan
lefthook installwires pre-commit + pre-push shims