Skip to main content
Update fields on a repository. Omitted keyword arguments are left unchanged. Required scope: write
repo = await mesa.repos.update(
    repo="app",
    name="renamed-app",
    default_bookmark="main",
)
Update upstream credentials without changing other repository fields:
from mesa_sdk.types import TokenAuth, UpstreamConfig

repo = await mesa.repos.update(
    repo="app",
    upstream=UpstreamConfig(
        url="https://github.com/acme/app.git",
        auth=TokenAuth(token="github_pat_..."),
    ),
)

Options

repo
str
required
Repository name to update.
org
str | None
Organization override.
name
str | None
New repository name.
default_bookmark
str | None
New default bookmark name.
upstream
UpstreamConfig | None | Unset
Omit to leave upstream unchanged. Pass None to remove the upstream entirely. Pass UpstreamConfig to set or replace the upstream URL.

Upstream auth tri-state

UpstreamConfig.auth has different meanings on update:
ValueBehavior
omitted / UNSETPreserve the existing stored credential while updating the URL.
NoneClear the stored credential and make the upstream public.
TokenAuth or UsernamePasswordAuthReplace the stored credential.

Response

id
str
Repository ID.
org
str
Organization slug.
name
str
Repository name.
default_bookmark
str
Default bookmark name.
head_change_id
str
Current change ID at the default bookmark tip.
upstream
UpstreamConfig | None
Configured upstream remote, or null when no upstream is configured.
created_at
datetime
Creation time.
tags
dict[str, str]
Repository tags.

UpstreamConfig

url
str
Upstream Git remote URL.
auth_kind
'token' | 'username_password' | None
Stored upstream authentication kind, or null when the upstream is public.