Skip to main content

triggers

Overview

Nametriggers
TypeResource
Idgoogle.cloudbuild.triggers

Fields

NameDatatypeDescription
idstringOutput only. Unique identifier of the trigger.
namestringUser-assigned name of the trigger. Must be unique within the project. Trigger names must meet the following requirements: + They must contain only alphanumeric characters and dashes. + They can be 1-64 characters long. + They must begin and end with an alphanumeric character.
descriptionstringHuman-readable description of this trigger.
createTimestringOutput only. Time when the trigger was created.
filterstringA Common Expression Language string.
gitlabEnterpriseEventsConfigobjectGitLabEventsConfig describes the configuration of a trigger that creates a build whenever a GitLab event is received.
sourceToBuildobjectGitRepoSource describes a repo and ref of a code repository.
bitbucketServerTriggerConfigobjectBitbucketServerTriggerConfig describes the configuration of a trigger that creates a build whenever a Bitbucket Server event is received.
eventTypestringEventType allows the user to explicitly set the type of event to which this BuildTrigger should respond. This field will be validated against the rest of the configuration if it is set.
autodetectbooleanAutodetect build configuration. The following precedence is used (case insensitive): 1. cloudbuild.yaml 2. cloudbuild.yml 3. cloudbuild.json 4. Dockerfile Currently only available for GitHub App Triggers.
buildobjectA build resource in the Cloud Build API. At a high level, a Build describes where to find source code, how to build it (for example, the builder image to run on the source), and where to store the built artifacts. Fields can include the following variables, which will be expanded when the build is created: - $PROJECT_ID: the project ID of the build. - $PROJECT_NUMBER: the project number of the build. - $LOCATION: the location/region of the build. - $BUILD_ID: the autogenerated ID of the build. - $REPO_NAME: the source repository name specified by RepoSource. - $BRANCH_NAME: the branch name specified by RepoSource. - $TAG_NAME: the tag name specified by RepoSource. - $REVISION_ID or $COMMIT_SHA: the commit SHA specified by RepoSource or resolved from the specified branch or tag. - $SHORT_SHA: first 7 characters of $REVISION_ID or $COMMIT_SHA.
gitFileSourceobjectGitFileSource describes a file within a (possibly remote) code repository.
webhookConfigobjectWebhookConfig describes the configuration of a trigger that creates a build whenever a webhook is sent to a trigger's webhook URL.
includeBuildLogsstringIf set to INCLUDE_BUILD_LOGS_WITH_STATUS, log url will be shown on GitHub page when build status is final. Setting this field to INCLUDE_BUILD_LOGS_WITH_STATUS for non GitHub triggers results in INVALID_ARGUMENT error.
includedFilesarrayIf any of the files altered in the commit pass the ignored_files filter and included_files is empty, then as far as this filter is concerned, we should trigger the build. If any of the files altered in the commit pass the ignored_files filter and included_files is not empty, then we make sure that at least one of those files matches a included_files glob. If not, then we do not trigger a build.
serviceAccountstringThe service account used for all user-controlled operations including UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild. If no service account is set, then the standard Cloud Build service account ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead. Format: projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}
resourceNamestringThe Trigger name with format: projects/{project}/locations/{location}/triggers/{trigger}, where {trigger} is a unique identifier generated by the service.
approvalConfigobjectApprovalConfig describes configuration for manual approval of a build.
filenamestringPath, from the source root, to the build configuration file (i.e. cloudbuild.yaml).
disabledbooleanIf true, the trigger will never automatically execute a build.
tagsarrayTags for annotation of a BuildTrigger
githubobjectGitHubEventsConfig describes the configuration of a trigger that creates a build whenever a GitHub event is received.
repositoryEventConfigobjectThe configuration of a trigger that creates a build whenever an event from Repo API is received.
pubsubConfigobjectPubsubConfig describes the configuration of a trigger that creates a build whenever a Pub/Sub message is published.
ignoredFilesarrayignored_files and included_files are file glob matches using https://golang.org/pkg/path/filepath/#Match extended with support for "**". If ignored_files and changed files are both empty, then they are not used to determine whether or not to trigger a build. If ignored_files is not empty, then we ignore any files that match any of the ignored_file globs. If the change has no files that are outside of the ignored_files globs, then we do not trigger a build.
substitutionsobjectSubstitutions for Build resource. The keys must match the following regular expression: ^_[A-Z0-9_]+$.
triggerTemplateobjectLocation of the source in a Google Cloud Source Repository.

Methods

NameAccessible byRequired ParamsDescription
projects_locations_triggers_getSELECTlocationsId, projectsId, triggersIdReturns information about a BuildTrigger. This API is experimental.
projects_locations_triggers_listSELECTlocationsId, projectsIdLists existing BuildTriggers. This API is experimental.
projects_triggers_getSELECTprojectId, triggerIdReturns information about a BuildTrigger. This API is experimental.
projects_triggers_listSELECTprojectIdLists existing BuildTriggers. This API is experimental.
projects_locations_triggers_createINSERTlocationsId, projectsIdCreates a new BuildTrigger. This API is experimental.
projects_triggers_createINSERTprojectIdCreates a new BuildTrigger. This API is experimental.
projects_locations_triggers_deleteDELETElocationsId, projectsId, triggersIdDeletes a BuildTrigger by its project ID and trigger ID. This API is experimental.
projects_triggers_deleteDELETEprojectId, triggerIdDeletes a BuildTrigger by its project ID and trigger ID. This API is experimental.
_projects_locations_triggers_listEXEClocationsId, projectsIdLists existing BuildTriggers. This API is experimental.
_projects_triggers_listEXECprojectIdLists existing BuildTriggers. This API is experimental.
projects_locations_triggers_patchEXEClocationsId, projectsId, triggersIdUpdates a BuildTrigger by its project ID and trigger ID. This API is experimental.
projects_locations_triggers_runEXEClocationsId, projectsId, triggersIdRuns a BuildTrigger at a particular source revision. To run a regional or global trigger, use the POST request that includes the location endpoint in the path (ex. v1/projects/{projectId}/locations/{region}/triggers/{triggerId}:run). The POST request that does not include the location endpoint in the path can only be used when running global triggers.
projects_locations_triggers_webhookEXEClocationsId, projectsId, triggersIdReceiveTriggerWebhook [Experimental] is called when the API receives a webhook request targeted at a specific trigger.
projects_triggers_patchEXECprojectId, triggerIdUpdates a BuildTrigger by its project ID and trigger ID. This API is experimental.
projects_triggers_runEXECprojectId, triggerIdRuns a BuildTrigger at a particular source revision. To run a regional or global trigger, use the POST request that includes the location endpoint in the path (ex. v1/projects/{projectId}/locations/{region}/triggers/{triggerId}:run). The POST request that does not include the location endpoint in the path can only be used when running global triggers.
projects_triggers_webhookEXECprojectId, triggerReceiveTriggerWebhook [Experimental] is called when the API receives a webhook request targeted at a specific trigger.