Links an existing project to a repository and opens a pull request that sets up the pipeline.
HTTP
PUT /projects/{projectId}/repository/githubAccess: Session token only. API keys get 403 with insufficient_scope.
Role: Organisation owner or admin. and project manager.
Path parameters #
| Parameter | Description |
|---|---|
projectId | The id of the project. |
Request body #
JSON.
| Field | Type | Required | Description |
|---|---|---|---|
repo | string | yes | The repository, such as acme/shop. |
installationId | integer | yes | The installationId of a connected account, from the overview. |
source | string | yes | Path of the source file in the repository, for example locales/en.json. No leading / or ... At most 200 characters. |
translations | string | yes | Pattern of the translation files, which must contain {lang}, for example locales/{lang}.json. |
JSON
{ "repo": "acme/shop", "installationId": 123, "source": "locales/en.json", "translations": "locales/{lang}.json" }Response 201 #
The link.
JSON
{
"repository": { ... },
"pullRequestUrl": "https://github.com/acme/shop/pull/1"
}Response fields #
| Field | Type | Description |
|---|---|---|
repository | object | The link, see Get the repository link. |
pullRequestUrl | string | The pull request that was opened. |
Errors #
| Status | error | When |
|---|---|---|
| 401 | unauthenticated | The token is missing or not valid. |
| 404 | not_found | The project does not exist in your organisation, you have no access to it, or projectId is not a UUID. |
| 403 | forbidden | You are not an owner or admin, or not a manager of the project. |
| 503 | github_not_configured | The GitHub integration is not set up on this server. |
| 409 | repository_linked | The repository is linked to another project. projectId says which. |
| 404 | not_found | The account is not connected to your organisation. |
| 422 | invalid_request | repo is not valid, or source or translations is not a valid path (invalid_path, needs_lang). |
| 502 | github_error | GitHub refused the request. message says why. |
| 429 | rate_limited | Too many requests, see Rate limiting. |
See Errors for the error format.