ci: skip lefthook on spec-sync bot push#1866
Conversation
pnpm install installs lefthook hooks on the runner, so the bot's git push runs typecheck/lint/build. When upstream schema drift breaks typecheck, the push fails and no PR is created. Set LEFTHOOK=0 and --no-verify so drift always opens a PR; the PR's own CI surfaces any breakage.
|
@modelcontextprotocol/client
@modelcontextprotocol/server
@modelcontextprotocol/express
@modelcontextprotocol/fastify
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
There was a problem hiding this comment.
LGTM — simple, targeted fix that correctly surfaces spec drift as a PR instead of silently dropping it.
Extended reasoning...
Overview
Single-file CI workflow change adding LEFTHOOK=0 env var and --no-verify flag to the git push in the spec-sync bot job. Two complementary mechanisms (env var + git flag) are belt-and-suspenders to skip lefthook hooks during the automated push.
Security Risks
No security concerns. The change only affects a CI workflow that pushes to a dedicated update-spec-types branch and opens a PR — no direct production impact, no auth or secrets changes.
Level of Scrutiny
Low. This is a mechanical CI fix for a clearly documented failure mode. The approach is idiomatic (LEFTHOOK=0 is the documented way to disable lefthook; --no-verify is the standard git flag) and the fix is narrowly scoped to the one step that was failing.
Other Factors
No bugs found, no outstanding reviewer comments, minimal blast radius. The PR description includes a link to the failed run demonstrating the root cause.
bhosmer-ant
left a comment
There was a problem hiding this comment.
Verified the safety net is intact: ruleset on main requires build/test status checks + approval, so a spec-sync PR with broken typecheck cannot merge. lefthook.yml pre-push is exactly typecheck/lint/build as the comment says. The rationale holds — better a visible red-CI PR than a silently-failed bot push hiding spec drift.
nit: LEFTHOOK=0 and --no-verify are redundant (either alone works); harmless to keep both.
Review by Claude, checked by Basil.
Skip lefthook's pre-push hooks when the spec-sync bot pushes its branch.
Motivation and Context
pnpm installinstalls lefthook git hooks on the runner, so the bot'sgit pushrunstypecheck:all/lint:all/build:all. When upstreamschema.tsdrifts in a way that requires SDK changes, typecheck fails and no PR is created — the drift is silently dropped instead of surfaced. This happened in run 23971433340. The PR's own CI is the right place for those checks.How Has This Been Tested?
Workflow-only change; verified the diff. The next scheduled/dispatched run will exercise it.
Breaking Changes
None.
Types of changes
Checklist
Additional context
Belt-and-suspenders: sets
LEFTHOOK=0and passes--no-verifyso this stays robust if the hook manager changes.