Git providers
Git connections for GitLab, Gitea, Bitbucket and plain git, and the GitHub App integration.
Two kinds of source integration. A git connection stores a token for a git host and drives repository listing, branch listing and push webhooks. A GitHub App is installed on an account or organisation through GitHub's manifest flow and covers repositories, branches, pull requests and previews.
The webhook receivers themselves are REST: see REST endpoints.
Git connections
gitProviders
Any signed-in principal. Returns [GitProvider!].
Git hosts other than GitHub that Deplo can connect to. Static catalogue.
query {
gitProviders {
id
label
defaultBaseUrl
hasApi
}
}gitConnections
Any signed-in principal. Returns [GitConnection!].
The active team's git connections, newest first.
query {
gitConnections {
id
provider
label
health
}
}gitRepos
Any signed-in principal. Returns [GitRepoSummary!].
Repositories a git connection can reach. Empty for plain git.
| Argument | Type | Description |
|---|---|---|
connectionId | String! |
query {
gitRepos(connectionId: "gitc_9f1c2ab7d3e4f5a6") {
fullName
defaultBranch
private
}
}gitBranches
Any signed-in principal. Returns [String!].
Branch names of a repository a git connection can reach.
| Argument | Type | Description |
|---|---|---|
connectionId | String! | |
fullName | String! |
query {
gitBranches(connectionId: "gitc_9f1c2ab7d3e4f5a6", fullName: "acme/shop")
}connectGitProvider
Needs manage_git. Returns GitConnection.
Store credentials for a git host, after proving the token works against it.
| Argument | Type | Description |
|---|---|---|
input | ConnectGitProviderInput! | |
input.allowPrivateEndpoint | Boolean | Allow an address inside the deployment, for a git server on your own network. Instance-admin only; refused otherwise. |
input.baseUrl | String! | Origin of the git host. A bare domain becomes https://; a path or embedded credentials are refused. |
input.label | String! | |
input.provider | String! | gitlab | bitbucket | gitea | git. |
input.token | String! | Access token. Write-only. |
input.username | String | Basic-auth username for the clone. Defaults per provider. |
mutation {
connectGitProvider(
input: { provider: "gitlab", label: "GitLab", baseUrl: "https://gitlab.com", token: "<personal access token>" }
) {
id
provider
label
health
}
}updateGitConnection
Needs manage_git. Returns GitConnection.
Rename a git connection or rotate its token.
| Argument | Type | Description |
|---|---|---|
id | String! | |
input | UpdateGitConnectionInput! | |
input.label | String | |
input.token | String | A replacement token. Omit to keep the stored one. |
input.username | String |
mutation {
updateGitConnection(id: "db_9f1c2ab7d3e4f5a6", input: { label: "GitLab (ops)" }) {
id
provider
label
health
}
}testGitConnection
Needs manage_git. Returns GitConnection.
Ask the provider who the stored token belongs to and record the answer.
| Argument | Type | Description |
|---|---|---|
id | String! |
mutation {
testGitConnection(id: "db_9f1c2ab7d3e4f5a6") {
id
provider
label
health
}
}removeGitConnection
Needs manage_git. Returns Int.
Disconnect a git provider. Returns how many apps were unlinked (their auto-deploy is turned off).
| Argument | Type | Description |
|---|---|---|
id | String! |
mutation {
removeGitConnection(id: "db_9f1c2ab7d3e4f5a6")
}GitHub Apps
startGithubConnect returns what the browser posts to GitHub. GitHub then sends the user back through the callback endpoint; there is no mutation to finish the flow.
githubApps
Any signed-in principal. Returns [GithubApp!].
Connected GitHub Apps in the active team.
query {
githubApps {
id
name
slug
installations {
id
accountLogin
}
}
}githubInstallations
Any signed-in principal. Returns [GithubInstallation!].
Installations of the active team's connected Apps.
query {
githubInstallations {
id
accountLogin
accountType
}
}githubRepos
Any signed-in principal. Returns [GithubRepo!].
Repositories accessible to a GitHub App installation.
| Argument | Type | Description |
|---|---|---|
installationId | String! |
query {
githubRepos(installationId: "ghi_9f1c2ab7d3e4f5a6") {
fullName
defaultBranch
private
}
}githubBranches
Any signed-in principal. Returns [String!].
Branch names for a repo accessible to an installation.
| Argument | Type | Description |
|---|---|---|
fullName | String! | |
installationId | String! |
query {
githubBranches(
fullName: "acme/shop"
installationId: "ghi_9f1c2ab7d3e4f5a6"
)
}startGithubConnect
Needs manage_git. Returns GithubConnectStart.
Begin the GitHub App manifest flow; returns the form's POST target, manifest and signed state.
| Argument | Type | Description |
|---|---|---|
org | String | |
returnTo | String | In-app path to send the browser back to once the App is installed. Anything that is not a plain in-app route is ignored, and the flow ends on Settings -> Git as before. |
mutation {
startGithubConnect(org: "acme") {
actionUrl
manifest
state
}
}removeGithubApp
Needs manage_git. Returns Boolean.
Disconnect a GitHub App and its installations. Returns true.
| Argument | Type | Description |
|---|---|---|
id | String! |
mutation {
removeGithubApp(id: "gitc_9f1c2ab7d3e4f5a6")
}See also
Did this page help you?