Repository navigation
feat(cli): add void github update to change an existing connection's branch/executor - #238
Merged
Merged
Conversation
…s branch/executor There was no CLI way to change an already-connected GitHub deploy connection: `void github connect` returns 409 when a project is already connected, so flipping the build executor (container <-> github_actions) or moving the deploy branch required a raw authenticated PATCH /projects/:id/github. This is the real blocker for a monorepo whose Void app lives in a subdirectory and must use the github_actions executor. `void github update [project] [--branch <name>] [--executor <type>]`: - resolves the project the same way `connect` does (positional / --project / VOID_PROJECT / linked .void/project.json) - fetches the current connection (GET); a missing connection maps to a friendly "run `void github connect` first" message - TTY: shows current branch + executor and prompts for new values, defaulting each to the current setting - non-TTY: requires at least one of --branch / --executor, else fails closed - sends only the changed fields to PATCH /projects/:id/github, and skips the API entirely when nothing changed Adds PlatformClient.getGithubConnection + updateGithubConnection, help/hint/docs entries, and unit tests (args parsing, client wire format, error mapping, and command behavior for all paths). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… update (review) Trim the --branch value in the `update` arg parser so a padded value like 'main ' can no longer be persisted (it would never match refs/heads/main at OIDC exchange time and would cancel in-flight builds for the old branch). The no-op check and PATCH now both use the canonical branch name. `connect` is left unchanged. Move the non-TTY missing-flags guard to the top of runGithubUpdate, before project resolution and getGithubConnection, so `void github update <app>` with no flags reports the usage error regardless of API state (a disconnected project no longer surfaces the 404 "connect first" message in its place). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cpojer
pushed a commit
that referenced
this pull request
Sep 11, 2026
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.
Motivation
Today there is no CLI way to change an existing GitHub deploy connection.
void github connectreturns409 project already connectedwhen a project is already connected, so the only way to flip the build executor (container↔github_actions) or move the deploy branch is a raw authenticatedPATCH /projects/:id/github.The concrete blocker: a monorepo whose Void app lives in a subdirectory must use the
github_actionsexecutor, but a project connected earlier ascontainercan only be flipped via the raw API. This command closes that gap.What it does
Adds
void github update [project] [options], calling the existing platform APIPATCH /projects/:id/github.connectdoes: positional /--project/VOID_PROJECT/ linked.void/project.json.GET /projects/:id/github). A missing connection (404) maps to a friendly message pointing atvoid github connectfirst.PATCH, and skips the API entirely when nothing changed (prints a "no changes" message).Flags
--project <name>--branch <name>--executor <type>containerorgithub_actions--executorreusesconnect's exact validation and error message (github: invalid --executor (expected container|github_actions).).Interactive + non-TTY behavior
@clack/promptshelpersconnectuses.--branch/--executor; if neither is given it fails closed with a clear message.Tests added
github-args.test.ts—updatearg parsing (project positional/--projectalias,--branch,--executor, validation + rejection cases) and the updated usage string.github-client.test.ts—getGithubConnection(GET) andupdateGithubConnection(PATCH) wire format, auth headers, exact JSON body, and error mapping.github-cmd.test.ts—describeUpdateError(connect-first mapping + fallthrough todescribeConnectError).github-update-cmd.test.ts— command behavior (non-TTY): executor-only, branch-only, both, not-connected error, missing-flags error, no-op/no-changes path, and unresolvable-slug error.All 102 github tests pass;
vp fmt --check,vp lint, andpackages/voidtypecheck are clean.🤖 Generated with Claude Code
Note
Medium Risk
Changing deploy branch or executor affects which pushes trigger builds and how they run; the change is scoped to CLI + existing PATCH API with conservative validation and no-op guards.
Overview
Adds
void github update [project]so users can change an existing GitHub auto-deploy connection’s deploy branch and/or build executor (containervsgithub_actions) without disconnecting or rawPATCHcalls. Repo and installation stay unchanged; the project must already be connected viavoid github connect.The CLI loads the current connection with GET
/projects/:id/github, then PATCHes only fields that actually differ. If nothing changes, it prints a no-op message and skips the API.--branchvalues are trimmed onupdateso padded names don’t break deploy/OIDC matching.TTY mode prompts for branch and executor (defaults = current). Non-TTY requires at least one of
--branch/--executor; that check runs before project lookup or any API call so CI gets a usage error instead of a misleading “connect first” 404.Also adds
PlatformClient.getGithubConnection/updateGithubConnection,describeUpdateError(404 “connection not found” → connect-first guidance), help/docs wiring, and unit tests for parsing, HTTP client, andrunGithubUpdate.Reviewed by Cursor Bugbot for commit 1cc1cc7. Bugbot is set up for automated code reviews on this repo. Configure here.