dcloud git branch-protection updateChange a branch protection rule
Only the fields sent are written. Editing in place matters because the alternative — create the replacement, delete the old one — leaves the branch unprotected in between.
Synopsis
dcloud git branch-protection update repoId ruleId [flags]Arguments
<repoId>Requiredstring
Also accepted as
--repo-id. Constraints: uuid<ruleId>Requiredstring
Also accepted as
--rule-id. Constraints: uuid
Flags
--branch-patternOptionalstring
The branch name or glob the rule covers, e.g. main or release/*
Constraints: 1-200 chars
--require-pull-requestOptionalboolean (--require-pull-request / --no-require-pull-request)
Changes land only through a pull request; direct pushes are refused (true on a new rule)
--required-approvalsOptionalnumber
Approvals a pull request needs before it can merge (0 on a new rule)
Constraints: integer, 0-10
--dismiss-stale-approvalsOptionalboolean (--dismiss-stale-approvals / --no-dismiss-stale-approvals)
A push to the pull request dismisses the approvals given before it (false on a new rule)
--require-code-owner-reviewOptionalboolean (--require-code-owner-review / --no-require-code-owner-review)
Every changed file CODEOWNERS assigns needs an approval from one of its owners
--require-status-checksOptionalboolean (--require-status-checks / --no-require-status-checks)
Required checks must pass before a pull request can merge (false on a new rule)
--required-checksOptionalarray of string
Workflow or status names that must pass; empty means every workflow a pull request to the branch triggers
Constraints: 1-200 chars
--block-force-pushOptionalboolean (--block-force-push / --no-block-force-push)
Refuse pushes that rewrite the branch history (true on a new rule)
--block-deletionOptionalboolean (--block-deletion / --no-block-deletion)
Refuse deleting the branch (true on a new rule)
--require-merge-queueOptionalboolean (--require-merge-queue / --no-require-merge-queue)
The branch moves only through its merge queue; direct pushes and the merge button are refused (false on a new rule)
--merge-queue-methodOptionalenum
How the queue merges each pull request (merge on a new rule)
One of:
merge,squash,rebase--merge-queue-build-concurrencyOptionalnumber
How many queued pull requests may be building at once (5 on a new rule)
Constraints: integer, 1-100
--merge-queue-min-group-sizeOptionalnumber
Fewest pull requests the queue waits for before it builds, up to the wait time (1 on a new rule)
Constraints: integer, 1-100
--merge-queue-max-group-sizeOptionalnumber
Most pull requests landed by one fast-forward (5 on a new rule)
Constraints: integer, 1-100
--merge-queue-wait-minutesOptionalnumber
Minutes to wait for the minimum group size before building anyway (5 on a new rule)
Constraints: integer, 0-360
--merge-queue-check-timeout-minutesOptionalnumber
Minutes a queue build may wait for its checks before it fails (60 on a new rule)
Constraints: integer, 1-360
--merge-queue-only-non-failingOptionalboolean (--merge-queue-only-non-failing / --no-merge-queue-only-non-failing)
Land only pull requests whose own build passed; off, a failed build still lands if a later build containing it passes (true on a new rule)
Example
dcloud git branch-protection update repoId ruleIdGenerated from the API description, the same one the API checks requests against and the CLI is built from.