update_branch_protection
Protect or unprotect a branch in your CI/CD pipeline with reversible changes and dry-run preview. Enforce safe push rules or lift them as needed.
Instructions
[WRITE][risk=medium] Protect/unprotect a branch; reversible.
Reads the branch's current protection first so the harness records an undo that replays this same tool with the prior settings. Pass dry_run=True to preview.
Args: project: Project id or full path. branch: Branch name (from list_branches). protect: True to protect the branch, False to remove protection. allow_force_push: Whether the protection permits force-push (default False — the safe setting). dry_run: If True, preview without changing. target: Server target name from config; omit for the default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| branch | Yes | ||
| target | No | ||
| dry_run | No | ||
| project | Yes | ||
| protect | No | ||
| allow_force_push | No |