Connect or update a project's repo connection
Changed onFull 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.
Request
- Base URLhttps://api.volcano.dev
- AuthHTTP bearer
Path parameters
Project ID
Request body
The caller's user_git_connections row (see /user/git/connections).
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.
Deprecated selector kept for a compatibility window; prefer repository_id. Either repository_id or repo_full_name is required.
Monorepo subdirectory the project builds from. Omit for the repo root.
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
Stable GitHub repository id (repository.id), the authoritative binding.
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.
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
- info
the endpoint scheme security
ProjectAccessTokenwas removed from the API
- info
- info
the endpoint scheme security
ProjectAccessTokenwas added to the API
- info