From 88b06362f195e816923a8f3ad5ea0bb29c085739 Mon Sep 17 00:00:00 2001 From: Ajax Davis Date: Sun, 30 Nov 2025 05:00:00 +1000 Subject: [PATCH] fix(ci): skip Lefthook installation in CI/Vercel environments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Problem:** Vercel deployments were failing during `pnpm install` because the `prepare` script tried to run `lefthook install`, which requires a git repository. Vercel's build environment doesn't have a proper `.git` directory, causing: ``` fatal: not a git repository (or any parent up to mount point /vercel) Error: exit status 128 ``` **Solution:** Skip Lefthook installation when running in CI or Vercel environments by checking `process.env.CI` and `process.env.VERCEL` before attempting to install git hooks. **Impact:** - Vercel deployments will now succeed - Local development still gets git hooks installed - GitHub Actions CI will skip hook installation (not needed in CI) - All previous tool execution fixes can now actually deploy 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- apps/web/.gitignore | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 apps/web/.gitignore diff --git a/apps/web/.gitignore b/apps/web/.gitignore new file mode 100644 index 0000000..e985853 --- /dev/null +++ b/apps/web/.gitignore @@ -0,0 +1 @@ +.vercel diff --git a/package.json b/package.json index 5bd7584..0669b4f 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "changeset": "changeset", "changeset:version": "changeset version && pnpm install --no-frozen-lockfile", "changeset:publish": "pnpm build && changeset publish", - "prepare": "node -e \"if (require('fs').existsSync('.git')) { require('child_process').execSync('lefthook install', {stdio: 'inherit'}) }\"" + "prepare": "node -e \"if (!process.env.CI && !process.env.VERCEL && require('fs').existsSync('.git')) { require('child_process').execSync('lefthook install', {stdio: 'inherit'}) }\"" }, "devDependencies": { "@biomejs/biome": "^1.9.4",