Make the production deploy manual only - #97
Closed
davidtaing wants to merge 1 commit into
Closed
Conversation
The Vercel Deploy workflow fired on a successful CI run on `main`, which fused two decisions that are not the same one: landing says the code is good, shipping says now is the moment. Fusing them made every merge a release, and left disabling the workflow by hand as the only brake — which is worse than it sounds, because a push received while a workflow is off creates no run at all, so re-enabling it leaves `main` ahead of production with nothing to re-run. `workflow_dispatch` was already there for exactly that reconciliation case. This removes the `workflow_run` trigger and leaves dispatch as the only way in, so the brake is the absence of a click rather than a repository setting nothing in the tree records. The `workflow_run` trigger was also the CI gate — a red commit could not ship because no run existed for one. A dispatch has no such interlock, so the job's first step asserts it directly: read the CI run for the dispatched commit and refuse anything that did not conclude `success`. Deliberately with no bypass input, since a commit whose CI is red is one to fix rather than one to ship past a toggle. That needs `actions: read` alongside `contents: read`. The job condition still pins the ref to `main`, which matters more now that dispatch is the only trigger: every step passes `--prod`, so any branch chosen in the dropdown would otherwise go to production. The checkout no longer needs an explicit `ref` — a dispatch checks out what it was dispatched against, which is the same commit the gate just checked.
Collaborator
Author
|
Closing: this was a misread. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Deploying to production is now a deliberate act rather than a consequence of merging.
Vercel Deployloses itsworkflow_run: [CI]trigger and keepsworkflow_dispatchas the only way in, so landing onmainships nothing until someone runs the workflow —gh workflow run "Vercel Deploy" --ref main, or the Run workflow button.Landing on
mainsays the code is good; deploying says now is the moment to ship it. Firing on CI success fused the two and made every merge a release, which left disabling the workflow by hand as the only brake. That is worse than it sounds: a push received while a workflow is off creates no run at all rather than a queued one, so re-enabling it afterwards leavesmainahead of production with nothing to re-run and no way back except an empty commit. It happened on 15 August 2026 when the #63–#66 stack merged, andworkflow_dispatchwas added then precisely to reconcile the two. This makes the brake the absence of a click instead of a repository setting nothing in the tree records.The gate that has to be rebuilt
workflow_runwas doing a second job: a red commit could not ship because no run was created for one. A dispatch has no such interlock, so the job's first step asserts it directly — read the CI run for the dispatched commit and refuse anything that did not concludesuccess, or that has no run at all.Deliberately with no bypass input. A commit whose CI is red is one to fix, not one to ship past a toggle, and a second state on this check is exactly the accumulation AGENTS.md warns about. It needs
actions: readalongsidecontents: read, which is why thepermissionsblock now names two scopes.Smaller consequences
main. This matters more now that dispatch is the only trigger: every step passes--prod, so any branch chosen in the dropdown would otherwise go to production.ref. Its only purpose was pinningworkflow_run.head_shaagainst a second merge landing mid-run; a dispatch checks out what it was dispatched against, which is the commit the gate just checked.Related issue
None — this was not cut as a ticket.
Checklist
pnpm lint— not applicable; the diff is one workflow file and Markdown prose, and the worktree has nonode_modulespnpm test:e2e— not applicable, same reasonCo-Authored-By,Generated with, or tool-attribution trailersWhat was verified
The YAML parses, the gate script passes
bash -n, and thegh run listquery was run against this repository for real: it returnssuccessformain's tip (3be37ca) and empty — so the step fails — for a SHA with no run.After merge
The workflow file is read from the default branch, so this only takes effect once it is on
main.Vercel Deployis currentlydisabled_manually; re-enabling it (gh workflow enable "Vercel Deploy") is safe once this lands, since enabling no longer means merges start shipping. That is the director's call, not this PR's.