mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-20 15:13:47 +01:00
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>
This commit is contained in:
1 parent
23922b72e6
commit
8fb37a72c0
3 files changed
+32
-2
No files matched your search
@@ -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?**
|
||||
|
||||
@@ -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?**
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user