projects

CreateBranchRule creates a branch rule in a given repository.

post/v1/{+parent}/branchRules

Request

  • Base URL: https://securesourcemanager.googleapis.com
  • URL: https://securesourcemanager.googleapis.com/v1/{+parent}/branchRules
  • Auth: one of:
    • OAuth 2 (implicit, authorization URL https://accounts.google.com/o/oauth2/auth, scopes: https://www.googleapis.com/auth/cloud-platform) and OAuth 2 (authorization code, authorization URL https://accounts.google.com/o/oauth2/auth, token URL https://accounts.google.com/o/oauth2/token, scopes: https://www.googleapis.com/auth/cloud-platform)
    • OAuth 2 (implicit, authorization URL https://accounts.google.com/o/oauth2/auth, scopes: https://www.googleapis.com/auth/securesourcemanager.read-write) and OAuth 2 (authorization code, authorization URL https://accounts.google.com/o/oauth2/auth, token URL https://accounts.google.com/o/oauth2/token, scopes: https://www.googleapis.com/auth/securesourcemanager.read-write)

Path parameters

parentstring required

Query parameters

branchRuleIdstring

Request body

allowStaleReviewsboolean

Optional. Determines if allow stale reviews or approvals before merging to the branch.

annotationsobject

Optional. User annotations. These attributes can only be set and used by the user. See https://google.aip.dev/128#annotations for more details such as format and size limitations.

createTimestring google-datetime

Output only. Create timestamp.

disabledboolean

Optional. Determines if the branch rule is disabled or not.

etagstring

Optional. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.

includePatternstring

Optional. The pattern of the branch that can match to this BranchRule. Specified as regex. .* for all branches. Examples: main, (main|release.*). Current MVP phase only support .* for wildcard.

minimumApprovalsCountinteger

Optional. The minimum number of approvals required for the branch rule to be matched.

minimumReviewsCountinteger

Optional. The minimum number of reviews required for the branch rule to be matched.

namestring

Identifier. A unique identifier for a BranchRule. The name should be of the format: projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}

requireCodeOwnerApprovalboolean

Optional. Determines if code owners must approve before merging to the branch.

requireCommentsResolvedboolean

Optional. Determines if require comments resolved before merging to the branch.

requireLinearHistoryboolean

Optional. Determines if require linear history before merging to the branch.

requirePullRequestboolean

Optional. Determines if the branch rule requires a pull request or not.

uidstring

Output only. Unique identifier of the repository.

updateTimestring google-datetime

Output only. Update timestamp.

Response

Successful response

Changes

    • breaking

      removed the request body

    • breaking

      removed the media type */* for the response with the status

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/securesourcemanager.read-write was removed from the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/securesourcemanager.read-write was removed from the endpoint's security scheme Oauth2c