diff --git a/products/cloudbuild/api.yaml b/products/cloudbuild/api.yaml index 0a96068cfba3..ecd96549f0bd 100644 --- a/products/cloudbuild/api.yaml +++ b/products/cloudbuild/api.yaml @@ -133,6 +133,11 @@ objects: This must be a relative path. If a step's dir is specified and is an absolute path, this value is ignored for that step's execution. + + - !ruby/object:Api::Type::Boolean + name: 'invertRegex' + description: | + Only trigger a build if the revision regex does NOT match the revision regex. - !ruby/object:Api::Type::String name: 'branchName' description: | @@ -198,6 +203,10 @@ objects: values: - :COMMENTS_DISABLED - :COMMENTS_ENABLED + - !ruby/object:Api::Type::Boolean + name: 'invertRegex' + description: | + If true, branches that do NOT match the git_ref will trigger a build. - !ruby/object:Api::Type::NestedObject name: 'push' description: | @@ -206,6 +215,10 @@ objects: - github.0.pull_request - github.0.push properties: + - !ruby/object:Api::Type::Boolean + name: 'invertRegex' + description: | + When true, only trigger a build if the revision regex does NOT match the git_ref regex. - !ruby/object:Api::Type::String name: 'branch' description: | diff --git a/third_party/terraform/tests/resource_cloudbuild_trigger_test.go b/third_party/terraform/tests/resource_cloudbuild_trigger_test.go index d3c4e7ccdfa3..e00c347f4a62 100644 --- a/third_party/terraform/tests/resource_cloudbuild_trigger_test.go +++ b/third_party/terraform/tests/resource_cloudbuild_trigger_test.go @@ -194,6 +194,7 @@ resource "google_cloudbuild_trigger" "build_trigger" { trigger_template { branch_name = "master" repo_name = "some-repo" + invert_regex = false } build { images = ["gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA"] @@ -221,6 +222,7 @@ resource "google_cloudbuild_trigger" "build_trigger" { trigger_template { branch_name = "master-updated" repo_name = "some-repo-updated" + invert_regex = true } build { images = ["gcr.io/$PROJECT_ID/$REPO_NAME:$SHORT_SHA"]