Protect branch
protect_branchCreate a protected-branch policy by defining push/merge permissions and an unprotect rule, with explicit acknowledgment to prevent accidental lockout.
Instructions
Create protected-branch policy after a capability preflight. An explicit acknowledgement and unprotect rule are required to avoid accidental lockout.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| project | Yes | GitLab project ID or full path such as group/project. | |
| allowed_to_push | No | ||
| allow_force_push | No | ||
| allowed_to_merge | No | ||
| allowed_to_unprotect | Yes | ||
| code_owner_approval_required | No | ||
| acknowledge_protection_change | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | GitLab response normalized for model use. |