Skip to content
Proud to collaborate with Microsoft for Startups

gcp.cloudbuild.connection.ensure ​

Ensure a Cloud Build 2nd-gen host connection (GitHub/GitLab) exists for private-repo source access.

Ensure a Cloud Build 2nd-gen host connection (GitHub/GitLab) exists.

A host connection is the credential boundary that lets Cloud Build read a PRIVATE source repo. For GitHub, pass app_installation_id (the Cloud Build GitHub App installation on the org/repo) and authorizer_credential_secret_version (a Secret Manager version holding a GitHub OAuth/PAT token with repo scope). Idempotent: describes an existing connection rather than failing.

Overview ​

PropertyValue
Workflow typeLinear
LibraryBase-gcp
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidYes—GCP CloudConnection UUID.
project_idstringNo—GCP project override; defaults to the connection project.
locationstringYes—Cloud Build region, e.g. us-central1.
connection_idstringYes—Host-connection id, e.g. github-islasoftwarefactory.
app_installation_idintegerNo—GitHub App installation id (Cloud Build GitHub App on the org/repo).
authorizer_credential_secret_versionstringNo—Secret Manager version holding the GitHub OAuth/PAT token (repo scope).
github_enterprise_configjsonNo—Raw githubEnterpriseConfig for GHE connections.
gitlab_configjsonNo—Raw gitlabConfig for GitLab connections.
annotationsjsonNo—Connection annotations.
poll_interval_secondsintegerNo—LRO poll interval.
timeout_secondsintegerNo—LRO wait timeout.

Output Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidNo—Echoed connection UUID.
project_idstringNo—Effective project id.
locationstringNo—Build region.
connection_idstringNo—Host-connection id.
connection_namestringNo—Full connection resource name.
createdbooleanNo—True when the connection was newly created.
installation_statestringNo—installationState.stage — COMPLETE means ready; PENDING_* means the GitHub App still needs authorizing.
connectionjsonNo—Sanitized provider connection resource.
failure_reasonstringNo—Human-readable failure reason.
failed_stepstringNo—Failed logical step.
failed_layerjsonNo—Engine failed layer envelope.
failed_at_statestringNo—State where failure occurred.
errorstringNo—Error message.
error_typestringNo—Error class.

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—preflight—
ensuringNoNo—complete—
preflightingNoNo—execute—
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
pendingpreflightpreflighting—
preflightingexecuteensuring—
ensuringcompletecompleted—
* (any state)failfailed—

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "gcp.cloudbuild.connection.ensure",
  "initial_data": {
    "connection_uuid": "value",
    "location": "value",
    "connection_id": "value"
  }
}