GitHub
Every /v1 route for github. This page is generated from the API's OpenAPI contract, so it always matches what the API accepts and returns.
Authentication, pagination, errors and idempotency work the same on every route. They are described once, in the API overview.
A repository's branch names
GET /v1/workspaces/{workspaceId}/github/branches
Key scopes: READ and PLATFORM_API.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
workspaceId | string | yes | The workspace's id. |
Query parameters
| Name | Type | Required | Notes |
|---|---|---|---|
limit | integer | no | Rows per page. Ignored when a cursor is given. |
cursor | string | no | The nextCursor of the previous page, unchanged. |
search | string | no | Only rows whose name contains this. Send the same value with every page of one walk. |
repo | string | yes | owner/name |
Returns
200with a page:{ data: V1Branch[], nextCursor }, where each item isV1Branch.
bash
curl "https://api.naijacloud.com/v1/workspaces/$WORKSPACE_ID/github/branches?repo=%E2%80%A6" \
-H "Authorization: Bearer $NC_API_KEY"The link that installs the GitHub App for this workspace
GET /v1/workspaces/{workspaceId}/github/install-url
Key scopes: READ and PLATFORM_API.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
workspaceId | string | yes | The workspace's id. |
Returns
200withV1GithubInstallUrl.
bash
curl "https://api.naijacloud.com/v1/workspaces/$WORKSPACE_ID/github/install-url" \
-H "Authorization: Bearer $NC_API_KEY"Repositories the workspace's GitHub App installations can see
GET /v1/workspaces/{workspaceId}/github/repositories
Key scopes: READ and PLATFORM_API.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
workspaceId | string | yes | The workspace's id. |
Query parameters
| Name | Type | Required | Notes |
|---|---|---|---|
limit | integer | no | Rows per page. Ignored when a cursor is given. |
cursor | string | no | The nextCursor of the previous page, unchanged. |
search | string | no | Only rows whose name contains this. Send the same value with every page of one walk. |
Returns
200with a page:{ data: V1Repository[], nextCursor }, where each item isV1Repository.
bash
curl "https://api.naijacloud.com/v1/workspaces/$WORKSPACE_ID/github/repositories" \
-H "Authorization: Bearer $NC_API_KEY"Types
V1Branch
| Field | Type | Notes |
|---|---|---|
name | string |
V1GithubInstallUrl
| Field | Type | Notes |
|---|---|---|
url | string | Open in a browser to install the Naijacloud GitHub App for this workspace. |
V1Repository
| Field | Type | Notes |
|---|---|---|
fullName | string | owner/name |
private | boolean | |
defaultBranch | string | |
installationId | string | Pass with repoFullName when creating a service. |