TypeScript SDK
Git repositories
Manage project git repositories with @tektona/sdk.
tek.repository manages a project's git repositories. It is project-scoped: the
org and project come from the client scope or a per-call { org, project }.
List
list returns one Page of repositories:
const page = await tek.repository.list({ limit: 50 });
const defaults = await tek.repository.list({ default: true }); // only the default repo set
for await (const repo of tek.repository.listAll()) console.log(repo.name);Repository fields: id, name, url, default_branch, is_default,
project_id, created_at, updated_at.
Create
const repo = await tek.repository.create({
name: 'web',
url: 'https://github.com/acme/web.git',
// default_branch: 'main',
// is_default: true,
});Update
await tek.repository.update(repo.id, {
name: 'web',
url: 'https://github.com/acme/web.git',
is_default: false,
});Delete
await tek.repository.delete(repo.id); // idempotent: a missing repository resolves cleanly