gcloud beta builds triggers update github Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud beta builds triggers update github - update GitHub trigger used by Cloud Build
- SYNOPSIS
gcloud beta builds triggers update github(TRIGGER:--region=REGION)(--trigger-config=PATH|--description=DESCRIPTION--ignored-files=[GLOB,…]--include-logs-with-status--included-files=[GLOB,…]--[no-]require-approval--service-account=SERVICE_ACCOUNT--branch-pattern=REGEX|--tag-pattern=REGEX|--comment-control=COMMENT_CONTROL; default="COMMENTS_ENABLED"--pull-request-pattern=REGEX--build-config=PATH|--inline-config=PATH| [--dockerfile=DOCKERFILE--dockerfile-image=DOCKERFILE_IMAGE:--dockerfile-dir=DOCKERFILE_DIR]--clear-substitutions|--remove-substitutions=[KEY,…] |--update-substitutions=[KEY=VALUE,…]--repository=REPOSITORY|--enterprise-config=ENTERPRISE_CONFIG--repo-name=REPO_NAME--repo-owner=REPO_OWNER)[GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(BETA)Update GitHub trigger used by Cloud Build.- EXAMPLES
- To update the branch pattern of the trigger:
gcloudbetabuildstriggersupdategithubmy-trigger--branch-pattern=".*"To update the build config of the trigger:
gcloudbetabuildstriggersupdategithubmy-trigger--build-config="cloudbuild.yaml"To update the substitutions of the trigger:
gcloudbetabuildstriggersupdategithubmy-trigger--update-substitutions=_REPO_NAME=my-repo,_BRANCH_NAME=master - POSITIONAL ARGUMENTS
- Trigger resource - Build Trigger. The arguments in this group can be used tospecify the attributes of this resource. (NOTE) Some attributes are not givenarguments in this group but can be set in other ways.
To set the
projectattribute:- provide the argument
TRIGGERon the command line with a fullyspecified name; - provide the argument
--projecton the command line; - set the property
core/project.
This must be specified.
TRIGGER- ID of the trigger or fully qualified identifier for the trigger.
To set the
triggerattribute:- provide the argument
TRIGGERon the command line.
This positional argument must be specified if any of the other arguments in thisgroup are specified.
- provide the argument
--region=REGION- The Cloud location for the trigger.
To set the
regionattribute:- provide the argument
TRIGGERon the command line with a fullyspecified name; - provide the argument
--regionon the command line; - set the property
builds/region.
- provide the argument
- provide the argument
- Trigger resource - Build Trigger. The arguments in this group can be used tospecify the attributes of this resource. (NOTE) Some attributes are not givenarguments in this group but can be set in other ways.
- REQUIRED FLAGS
- Exactly one of these must be specified:
--trigger-config=PATH- Path to Build Trigger config file (JSON or YAML format). For more details, seehttps://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.triggers#BuildTrigger
- Flag based trigger configuration
--description=DESCRIPTION- Build trigger description.
--ignored-files=[GLOB,…]- Glob filter. Changes only affecting ignored files won't trigger builds.
--include-logs-with-status- Build logs will be sent back to GitHub as part of the checkrun result.
--included-files=[GLOB,…]- Glob filter. Changes affecting at least one included file will trigger builds.
--[no-]require-approval- Require manual approval for triggered builds. Use
--require-approvalto enable and--no-require-approvalto disable. --service-account=SERVICE_ACCOUNT- The service account used for all user-controlled operations includingUpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild. If no serviceaccount is set, then the standard Cloud Build service account([PROJECT_NUM]@system.gserviceaccount.com) is used instead. Format:
projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}. - At most one of these can be specified:
--branch-pattern=REGEX- A regular expression specifying which git branches to match.
This pattern is used as a regular expression search for any incoming pushes. Forexample, --branch-pattern=foo will match "foo", "foobar", and "barfoo". Eventson a branch that does not match will be ignored.
The syntax of the regular expressions accepted is the syntax accepted by RE2 anddescribed athttps://github.com/google/re2/wiki/Syntax.
--tag-pattern=REGEX- A regular expression specifying which git tags to match.
This pattern is used as a regular expression search for any incoming pushes. Forexample, --tag-pattern=foo will match "foo", "foobar", and "barfoo". Events on atag that does not match will be ignored.
The syntax of the regular expressions accepted is the syntax accepted by RE2 anddescribed athttps://github.com/google/re2/wiki/Syntax.
- Pull Request settings
--comment-control=COMMENT_CONTROL; default="COMMENTS_ENABLED"- Require a repository collaborator or owner to comment '/gcbrun' on a pullrequest before running the build.
COMMENT_CONTROLmustbe one of:COMMENTS_DISABLED- Do not require comments on Pull Requests before builds are triggered.
COMMENTS_ENABLED- Enforce that repository owners or collaborators must comment on Pull Requestsbefore builds are triggered.
COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY- Enforce that repository owners or collaborators must comment on externalcontributors' Pull Requests before builds are triggered.
--pull-request-pattern=REGEX- A regular expression specifying which base git branch to match for pull requestevents.
This pattern is used as a regex search for the base branch (the branch you aretrying to merge into) for pull request updates. For example,--pull-request-pattern=foo will match "foo", "foobar", and "barfoo".
The syntax of the regular expressions accepted is the syntax accepted by RE2 anddescribed athttps://github.com/google/re2/wiki/Syntax.
- At most one of these can be specified:
--build-config=PATH- Path to a YAML or JSON file containing the build configuration in therepository.
For more details, see:https://cloud.google.com/cloud-build/docs/build-config
--inline-config=PATH- Local path to a YAML or JSON file containing a build configuration.
- Dockerfile build configuration flags
--dockerfile=DOCKERFILE- Path of Dockerfile to use for builds in the repository.
If specified, a build config will be generated to run docker build using thespecified file.
The filename is relative to the Dockerfile directory.
This flag argument must be specified if any of the other arguments in this groupare specified.
--dockerfile-image=DOCKERFILE_IMAGE- Docker image name to build.
This flag argument must be specified if any of the other arguments in this groupare specified.
--dockerfile-dir=DOCKERFILE_DIR- Location of the directory containing the Dockerfile in the repository.
The directory will also be used as the Docker build context.
- At most one of these can be specified:
--clear-substitutions- Clear existing substitutions.
--remove-substitutions=[KEY,…]- Remove existing substitutions if present.
--update-substitutions=[KEY=VALUE,…]- Update or add to existing substitutions. Substitutions are parameters to besubstituted or add in the build specification.
For example (using some nonsensical substitution keys; all keys must begin withan underscore):
gcloudbuildstriggersupdate…--update-substitutions_FAVORITE_COLOR=blue,_NUM_CANDIES=10This will add the provided substitutions to the existing substitutions andresults in a build where every occurrence of
${_FAVORITE_COLOR}incertain fields is replaced by "blue", and similarly for${_NUM_CANDIES}and "10".Only the following built-in variables can be specified with the
--substitutionsflag: REPO_NAME, BRANCH_NAME, TAG_NAME,REVISION_ID, COMMIT_SHA, SHORT_SHA.For more details, see:https://cloud.google.com/build/docs/build-config-file-schema#substitutions
- At most one of these can be specified:
--repository=REPOSITORY- Repository resource (2nd gen) to use, in the format"projects/*/locations/*/connections/*/repositories/
". - --enterprise-config
=ENTERPRISE_CONFIG - Resource name of the GitHub Enterprise config that should be applied to thisinstallation.
For example:"projects/{$project_id}/locations/{$location_id}/githubEnterpriseConfigs/{$config_id}
- --repo-name
=REPO_NAME - Name of the GitHub Repository.
- --repo-owner
=REPO_OWNER - Owner of the GitHub Repository.
- Exactly one of these must be specified:
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$gcloud helpfor details. - NOTES
- This command is currently in beta and might change without notice. Thesevariants are also available:
gcloudbuildstriggersupdategithubgcloudalphabuildstriggersupdategithub
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-13 UTC.