-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathlefthook.yml
More file actions
38 lines (36 loc) · 1.57 KB
/
Copy pathlefthook.yml
File metadata and controls
38 lines (36 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# lefthook.yml — BILLING-IMMUNE local CI gate for unsloth-mcp-server
#
# WHY: GitHub Actions gets account-level billing-blocked ("job not started —
# payments failed / spending limit"), silently killing CI across every private
# repo at once. These git hooks run the same checks LOCALLY at commit/push time,
# consuming ZERO CI minutes. The gate cannot drift from CI because there is one
# source of truth: package.json scripts + tsc.
#
# This repo has NO tests, NO lint config, and NO CI workflow today. The only real
# validation that exists is the TypeScript compiler (strict mode is on in
# tsconfig.json). So the gate IS the typecheck/build. See risks for the gap.
#
# pre-commit = fast subset : `tsc --noEmit` (typecheck only, no emit). ~1-3s.
# pre-push = FULL gate : `npm run build` (tsc + chmod, the real artifact)
# + `npm run check:pack` (publish safety).
#
# check:pack exists because build/ is gitignored: without a `prepack` script,
# `npm publish` from a clean checkout shipped a tarball with NO executable while
# package.json's `bin` still pointed at build/index.js. It packs exactly as
# publish would and fails if the entry point is absent.
#
# Bypass in an emergency with: git commit --no-verify / git push --no-verify
# (Use sparingly — bypassing is how broken code reaches the default branch.)
pre-commit:
parallel: false
commands:
typecheck:
glob: "*.{ts,tsx}"
run: npx tsc --noEmit
pre-push:
parallel: false
commands:
build:
run: npm run build
publish-safety:
run: npm run check:pack