From 8fb37a72c0b657452f272b5d6251c29fd75f2070 Mon Sep 17 00:00:00 2001 From: garrytan Date: Thu, 8 Oct 2026 06:34:29 +0000 Subject: [PATCH] fix(setup-deploy): Vercel auto-deploys only when connected to the Git repo /setup-deploy stated that Vercel always deploys on push, which is false for CLI-only projects with no Git integration, and its nothing-detected path did not say why such a project is invisible to detection. Qualify the Vercel trigger (ask for and record the CLI deploy command otherwise) and note that `vercel link` creates .vercel/ so a re-run detects the project. Adopts the Vercel accuracy part of #2992 (rewritten on current main); the third-party bring-up tool pointer is not adopted. Co-authored-by: mikehasa <91774998+mikehasa@users.noreply.github.com> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- setup-deploy/SKILL.md | 4 +++- setup-deploy/SKILL.md.tmpl | 4 +++- test/setup-deploy-vercel-trigger.test.ts | 26 ++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 test/setup-deploy-vercel-trigger.test.ts diff --git a/setup-deploy/SKILL.md b/setup-deploy/SKILL.md index 4c9b2e1dc..f6b6671e1 100644 --- a/setup-deploy/SKILL.md +++ b/setup-deploy/SKILL.md @@ -480,7 +480,7 @@ If vercel.json or .vercel detected: 1. Check for `vercel` CLI: `which vercel 2>/dev/null` 2. If installed: `vercel ls --prod 2>/dev/null | head -3` -3. Vercel deploys automatically on push — preview on PR, production on merge to the default branch +3. Vercel deploys automatically on push — preview on PR, production on merge to the default branch — only when the Vercel project is connected to this Git repository. For a CLI-only project, ask how production deploys run and record that command as the deploy trigger 4. Set health check: the production URL from vercel project settings Ask for the production URL if not available from the CLI, then confirm it before writing. @@ -510,6 +510,8 @@ If deploy workflows detected but no platform config: If nothing detected: +A project deployed only with the Vercel CLI has no `vercel.json` or `.vercel/`; `vercel link` creates `.vercel/`, so a re-run detects it. + Use AskUserQuestion to gather the information: 1. **How are deploys triggered?** diff --git a/setup-deploy/SKILL.md.tmpl b/setup-deploy/SKILL.md.tmpl index d1aa78707..2a718d518 100644 --- a/setup-deploy/SKILL.md.tmpl +++ b/setup-deploy/SKILL.md.tmpl @@ -121,7 +121,7 @@ If vercel.json or .vercel detected: 1. Check for `vercel` CLI: `which vercel 2>/dev/null` 2. If installed: `vercel ls --prod 2>/dev/null | head -3` -3. Vercel deploys automatically on push — preview on PR, production on merge to the default branch +3. Vercel deploys automatically on push — preview on PR, production on merge to the default branch — only when the Vercel project is connected to this Git repository. For a CLI-only project, ask how production deploys run and record that command as the deploy trigger 4. Set health check: the production URL from vercel project settings Ask for the production URL if not available from the CLI, then confirm it before writing. @@ -151,6 +151,8 @@ If deploy workflows detected but no platform config: If nothing detected: +A project deployed only with the Vercel CLI has no `vercel.json` or `.vercel/`; `vercel link` creates `.vercel/`, so a re-run detects it. + Use AskUserQuestion to gather the information: 1. **How are deploys triggered?** diff --git a/test/setup-deploy-vercel-trigger.test.ts b/test/setup-deploy-vercel-trigger.test.ts new file mode 100644 index 000000000..17bb74037 --- /dev/null +++ b/test/setup-deploy-vercel-trigger.test.ts @@ -0,0 +1,26 @@ +import { describe, expect, test } from 'bun:test'; +import * as fs from 'fs'; +import * as path from 'path'; + +const SKILL = fs.readFileSync(path.resolve(import.meta.dir, '..', 'setup-deploy', 'SKILL.md'), 'utf-8'); + +function section(heading: string, next: string): string { + const start = SKILL.indexOf(heading); + expect(start).toBeGreaterThanOrEqual(0); + return SKILL.slice(start, SKILL.indexOf(next, start + heading.length)); +} + +describe('setup-deploy does not assume Vercel deploys on push', () => { + test('auto-deploy is conditional on a Git-connected Vercel project', () => { + const vercel = section('#### Vercel', '#### Netlify'); + expect(vercel).toContain('only when the Vercel project is connected to this Git repository'); + expect(vercel).toContain('For a CLI-only project, ask how production deploys run and record that command as the deploy trigger'); + }); + + test('the nothing-detected path explains how a CLI-only Vercel project becomes detectable', () => { + const manual = section('#### Custom / Manual', '1. **How are deploys triggered?**'); + expect(manual).toContain('deployed only with the Vercel CLI has no `vercel.json` or `.vercel/`'); + expect(manual).toContain('`vercel link` creates `.vercel/`'); + expect(SKILL).not.toMatch(/GoLive/i); + }); +});