Skip to main content
POST
Connect a repository

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Connect a repository to the organisation.

provider
enum<string>
required
Available options:
github,
gitlab,
bitbucket_cloud
owner
string
required

The owner, group or workspace, as one path segment.

name
string
required

The repository name, as one path segment.

credential_name
string

The organisation's stored Git credential the repository is read and cloned with.

default_branch
string

The branch the pipeline file is read from; main when empty.

application_id
string

An application of this organisation to link; empty links none.

cluster_id
string

A CI cluster override: a cluster of this organisation whose agent runs pipeline steps; empty stores none.

workspaces_only
boolean
default:false

Connect the repository for Ankra Workspaces only: its pipeline file is not read, no definition is recorded, no run is started from any trigger and no commit status or check run is posted.

Response

The repository as stored, and what the connect did with its committed pipeline file.

A repository just connected, and what the connect did with its committed pipeline file.

id
string<uuid>
required
organisation_id
string<uuid>
required
provider
enum<string>
required
Available options:
github,
gitlab,
bitbucket_cloud
owner
string
required
name
string
required
credential_name
string
required
default_branch
string
required
application_id
string | null
required

The linked application; null when none.

cluster_id
string | null
required

The repository's CI cluster override; null when its runs follow the organisation's CI settings.

created_at
string<date-time>
required
updated_at
string<date-time>
required
last_trigger
object | null
required

What the trigger last decided for this repository; null when it has never decided anything.

definition
object
required

What the connect did with the committed pipeline file.

merge_train_enabled
boolean

Whether the repository's merge train is on (GET .../merge-train answers the same value with the queue).

merge_train_max_cars
integer

How many pull requests the repository's merge train tests at once.

Required range: 1 <= x <= 8
workspaces_only
boolean

The repository is connected for Ankra Workspaces only: no push, pull request, tag, schedule, merge train or manual dispatch starts a pipeline run for it, no commit status or check run is posted for it, and no pipeline definition is recorded for it. Workspaces (up, runs, the clone credential, workspace profiles) work as for any connected repository.