Projects
Git Connections

Connect or update a project's repo connection

Changed on

Full replace, following Vercel's model: many projects may point at the same repo, so this only binds the project — it never creates or deletes git-provider state. Used for both the initial connect and later edits (repo change, root directory, production branch). Resolves the repository_id or repo_full_name selector against the repos accessible through installation_id via connection_id's stored GitHub user token, then persists repository metadata only from that validated GitHub response.

Project access tokens are refused. Which repository a project deploys from is a person's decision, made with a platform token or in the dashboard. A project access token can still change the root directory and production branch through PUT /projects/{id}/git-connection/root-directory and PUT /projects/{id}/git-connection/production-branch.

put/projects/{id}/git-connection

Request

  • Base URL
    https://api.volcano.dev
  • Auth
    HTTP bearer

Path parameters

id, string uuid required

Project ID

Request body

ConnectProjectGitRequest required
connection_id, string uuid required

The caller's user_git_connections row (see /user/git/connections).

installation_id, integer required
repository_id, integer

Stable GitHub repository id (repository.id), the preferred selector. Either repository_id or repo_full_name is required; when both are given they must identify the same live repository.

repo_full_name, string

Deprecated selector kept for a compatibility window; prefer repository_id. Either repository_id or repo_full_name is required.

root_directory, string

Monorepo subdirectory the project builds from. Omit for the repo root.

production_branch, string

The branch a push must land on to deploy, with three cases, because this is a full replace and a read-modify-write client sends back whatever it read. Omit it to follow the repository's GitHub default branch, which also discards a branch set earlier. Send back the branch the project already deploys from, when that is the repository's default, and nothing changes either way — a project pinned to that branch stays pinned. Sending the default branch when the project deploys from something else returns it to following the default, including on a rebind, where a pin describes a branch chosen for the repository being left. Any other branch becomes the project's own choice, exempt from later default-branch renames. Validated as a Git branch name only: it does not have to exist yet, so a project can be pointed at a branch about to be pushed. Changing repository and naming a branch other than the new repository's default in one request is refused with 400, because the branch named is almost always the previous repository's, echoed back — connect first, then set the branch.

Response

The project's repo connection

ProjectGitConnection required
repo_installation_id, integer required
repo_id, integer required

Stable GitHub repository id (repository.id), the authoritative binding.

repo_full_name, string required
root_directory, string required
production_branch, string required

The branch a push must land on to deploy. Follows the repository's GitHub default branch unless the project set its own, which a default-branch rename on GitHub then leaves alone.

updated_at, string date-time required

When the connection last changed: its repository, root directory or production branch. Naming the branch it already uses, and other changes to the project, leave it alone. A connection that has not changed since Volcano began tracking this reports the project's last change before then.

Changes