Deplo

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.

ArgumentTypeDescription
connectionIdString!
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.

ArgumentTypeDescription
connectionIdString!
fullNameString!
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.

ArgumentTypeDescription
inputConnectGitProviderInput!
input.allowPrivateEndpointBooleanAllow an address inside the deployment, for a git server on your own network. Instance-admin only; refused otherwise.
input.baseUrlString!Origin of the git host. A bare domain becomes https://; a path or embedded credentials are refused.
input.labelString!
input.providerString!gitlab | bitbucket | gitea | git.
input.tokenString!Access token. Write-only.
input.usernameStringBasic-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.

ArgumentTypeDescription
idString!
inputUpdateGitConnectionInput!
input.labelString
input.tokenStringA replacement token. Omit to keep the stored one.
input.usernameString
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.

ArgumentTypeDescription
idString!
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).

ArgumentTypeDescription
idString!
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.

ArgumentTypeDescription
installationIdString!
query {
  githubRepos(installationId: "ghi_9f1c2ab7d3e4f5a6") {
    fullName
    defaultBranch
    private
  }
}

githubBranches

Any signed-in principal. Returns [String!].

Branch names for a repo accessible to an installation.

ArgumentTypeDescription
fullNameString!
installationIdString!
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.

ArgumentTypeDescription
orgString
returnToStringIn-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.

ArgumentTypeDescription
idString!
mutation {
  removeGithubApp(id: "gitc_9f1c2ab7d3e4f5a6")
}

See also

Did this page help you?

On this page