dcloud git branch-protection update

Change a branch protection rule

IAM git:ManageBranchProtectionChanges stateAsks before it deletes (-y skips)

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>Required

    string

    Also accepted as --repo-id. Constraints: uuid

  • <ruleId>Required

    string

    Also accepted as --rule-id. Constraints: uuid

Flags

  • --branch-patternOptional

    string

    The branch name or glob the rule covers, e.g. main or release/*

    Constraints: 1-200 chars

  • --require-pull-requestOptional

    boolean (--require-pull-request / --no-require-pull-request)

    Changes land only through a pull request; direct pushes are refused (true on a new rule)

  • --required-approvalsOptional

    number

    Approvals a pull request needs before it can merge (0 on a new rule)

    Constraints: integer, 0-10

  • --dismiss-stale-approvalsOptional

    boolean (--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-reviewOptional

    boolean (--require-code-owner-review / --no-require-code-owner-review)

    Every changed file CODEOWNERS assigns needs an approval from one of its owners

  • --require-status-checksOptional

    boolean (--require-status-checks / --no-require-status-checks)

    Required checks must pass before a pull request can merge (false on a new rule)

  • --required-checksOptional

    array 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-pushOptional

    boolean (--block-force-push / --no-block-force-push)

    Refuse pushes that rewrite the branch history (true on a new rule)

  • --block-deletionOptional

    boolean (--block-deletion / --no-block-deletion)

    Refuse deleting the branch (true on a new rule)

  • --require-merge-queueOptional

    boolean (--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-methodOptional

    enum

    How the queue merges each pull request (merge on a new rule)

    One of: merge, squash, rebase

  • --merge-queue-build-concurrencyOptional

    number

    How many queued pull requests may be building at once (5 on a new rule)

    Constraints: integer, 1-100

  • --merge-queue-min-group-sizeOptional

    number

    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-sizeOptional

    number

    Most pull requests landed by one fast-forward (5 on a new rule)

    Constraints: integer, 1-100

  • --merge-queue-wait-minutesOptional

    number

    Minutes to wait for the minimum group size before building anyway (5 on a new rule)

    Constraints: integer, 0-360

  • --merge-queue-check-timeout-minutesOptional

    number

    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-failingOptional

    boolean (--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 ruleId

Generated from the API description, the same one the API checks requests against and the CLI is built from.