Skip to content

Keep automatic Vercel deploys on main only - #186

Merged
Programcode merged 1 commit into
mainfrom
cursor/opt-in-vercel-previews-49c8
Oct 22, 2026
Merged

Programcode merged 1 commit into
mainfrom
cursor/opt-in-vercel-previews-49c8

Conversation

@Programcode

@Programcode Programcode commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

A push to any branch other than main no longer starts a Vercel build. Agent and PR branches were creating a preview on both debate-navigator and debatelab-staging for every push, which used up the Hobby plan's 100 deployments a day.

Mechanism

vercel.json sets git.deploymentEnabled to {"main": true, "**": false}.

Vercel matches those keys with minimatch. A branch deploys when any matching rule is true, and a branch that matches nothing defaults to true, so the ** rule has to stay. * does not match a /, which would leave branches such as cursor/… deploying. main matches both rules and still deploys because one of them is true. Docs: Git configuration.

This is not an Ignored Build Step. Vercel creates that deployment before the script runs, and a skip still counts toward the daily cap (why commits do not trigger deployments). deploymentEnabled decides before a deployment exists, so a skipped push does not count. A commit message such as [preview] cannot turn it back on.

What still deploys

Both Vercel projects read this file. Recent production deployments on debate-navigator and debatelab-staging are from main. There is no separate staging git branch. debatelab-staging's production site keeps tracking main (https://debatelab-staging.vercel.app).

A branch that does not contain this vercel.json still deploys on push. After this is on main, branches cut from main inherit it.

How to request a preview

Only when a real UI change needs a hosted URL. Local npm run dev:preview and verify-debatelab do not spend a deployment.

From the repo root, with the CLI logged in (vercel login, or VERCEL_TOKEN in the environment; never in the repo):

npx vercel link --yes --non-interactive --scope adam-gaborjanis-projects --project debatelab-staging
npx vercel deploy --yes --non-interactive --scope adam-gaborjanis-projects

That is one staging-pinned preview. Leave off --prod. Do not run vercel --yes before the link: the first deployment of a new project is production. Link debate-navigator instead only when the preview has to use production data. One preview is enough.

Adam can do the same from the Vercel dashboard: Create Deployment, pick the branch, leave the target as Preview.

Dashboard

No project setting needs to change. Production on both projects already tracks main, and this file is what turns the other branches off.

Verification

npm run verify passed locally on this commit: docs check, lint, typecheck, unit tests, collaboration tests, edge tests, build, service worker, and 43 desktop Chromium @smoke tests. That is a local pass. GitHub Actions were queued when this PR opened; a queued or skipped job is not a CI pass. No production deploy and no Vercel project setting was changed.

Open in Web Open in Cursor 

Agent branch pushes were building a preview on both Vercel projects and
hit the Hobby plan's 100 deployments a day. git.deploymentEnabled now
deploys main and skips every other branch before a deployment exists,
so a skipped push does not count. A preview is an explicit CLI deploy.

Co-authored-by: Gáborjáni-Szabó Ádám <Programcode@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 22, 2026 15:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between c27cace and 7302099.

📒 Files selected for processing: 9
  • AGENTS.md
  • README.md
  • docs/architecture.md
  • docs/development.md
  • docs/operations.md
  • docs/staging.md
  • docs/standards/security.md
  • src/test/vercel-deployment-config.test.ts
  • vercel.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing.

Comment @coderabbitai help to get the list of available commands.

@Programcode
Programcode merged commit cd1c814 into main Oct 22, 2026
3 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants