Resource: BranchRule
Metadata of a BranchRule. BranchRule is the protection rule to enforce pre-defined rules on desginated branches within a repository.
JSON representation |
---|
{
"name": string,
"uid": string,
"createTime": string,
"updateTime": string,
"annotations": {
string: string,
...
},
"etag": string,
"includePattern": string,
"disabled": boolean,
"requirePullRequest": boolean,
"minimumReviewsCount": integer,
"minimumApprovalsCount": integer,
"requireCommentsResolved": boolean,
"allowStaleReviews": boolean,
"requireLinearHistory": boolean,
"requiredStatusChecks": [
{
object ( |
Fields | |
---|---|
name |
Optional. A unique identifier for a BranchRule. The name should be of the format: |
uid |
Output only. Unique identifier of the repository. |
createTime |
Output only. Create timestamp. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
updateTime |
Output only. Update timestamp. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
annotations |
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. An object containing a list of |
etag |
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. |
includePattern |
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 |
disabled |
Optional. Determines if the branch rule is disabled or not. |
requirePullRequest |
Optional. Determines if the branch rule requires a pull request or not. |
minimumReviewsCount |
Optional. The minimum number of reviews required for the branch rule to be matched. |
minimumApprovalsCount |
Optional. The minimum number of approvals required for the branch rule to be matched. |
requireCommentsResolved |
Optional. Determines if require comments resolved before merging to the branch. |
allowStaleReviews |
Optional. Determines if allow stale reviews or approvals before merging to the branch. |
requireLinearHistory |
Optional. Determines if require linear history before merging to the branch. |
requiredStatusChecks[] |
Optional. List of required status checks before merging to the branch. |
Check
Check is a type for status check.
JSON representation |
---|
{ "context": string } |
Fields | |
---|---|
context |
Required. The context of the check. |
Methods |
|
---|---|
|
CreateBranchRule creates a branch rule in a given repository. |
|
DeleteBranchRule deletes a branch rule. |
|
GetBranchRule gets a branch rule. |
|
ListBranchRules lists branch rules in a given repository. |
|
UpdateBranchRule updates a branch rule. |