create_branch_restriction
Create branch protection rules in Bitbucket to restrict pushes, merges, deletions, or enforce requirements like CI passes and approvals.
Instructions
Create a branch restriction (protection rule).
Args:
repo_slug: Repository slug
kind: Type of restriction. Common values:
- "push" - Restrict who can push
- "force" - Restrict force push
- "delete" - Restrict branch deletion
- "restrict_merges" - Restrict who can merge
- "require_passing_builds_to_merge" - Require CI to pass
- "require_approvals_to_merge" - Require PR approvals
- "require_default_reviewer_approvals_to_merge"
- "require_no_changes_requested"
- "require_tasks_to_be_completed"
pattern: Branch pattern (e.g., "main", "release/*"). Required for glob match.
branch_match_kind: How to match branches - "glob" (pattern) or "branching_model" (development/production)
branch_type: Branch type when using branching_model - "development", "production", or specific category
value: Numeric value for restrictions that need it (e.g., number of required approvals)
Returns:
Created restriction info with IDInput Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_slug | Yes | ||
| kind | Yes | ||
| pattern | No | ||
| branch_match_kind | No | glob | |
| branch_type | No | ||
| value | No |