"gcloud beta builds triggers" error with the "--name" flag

It is a very simple problem: I am using the following command:

gcloud beta builds triggers create github \
    --name="trigger_by_master_push" \
    --repo-owner="{REPO_OWNER}" \
    --repo-name="{REPO_NAME}" \
    --pull-request-pattern="^master$" \
    --build-config="cloudbuild.yaml"

With the structure given in the documentation here

Gives me the error:

ERROR: (gcloud.beta.builds.triggers.create.github) unrecognized arguments: --name=trigger_by_master_push (did you mean '--repo-name'?)

Upvotes: 1

Views: 769

Answers (1)

Ajordat
Ajordat

Reputation: 1392

This seems like a version problem, since there was an update about Cloud Build trigger's name on GitHub on the 17th of August. I run the command with the beta component on version "2020.09.03" (gcloud SDK on 309.0.0) and it worked for me.

As you have noticed, the problem can be solved updating the beta component with:

gcloud components update

Upvotes: 1

Related Questions