gluecron_set_branch_protection
Set branch protection for one branch (partial update: fields you omit keep their value). Edits the rule named exactly after the branch; when only a glob rule covers it, a new exact rule is created seeded from the glob's settings and checks. required_checks replaces the required-check list ([] clears it). require_pr_run: a required check that names a workflow is met only by that workflow's pull_request run. Requires ADMIN access to the repo and 'repo' scope. Audit-logged. Returns the resulting rule plus {created, warnings}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | Repo name | |
| owner | Yes | Repo owner — username or organisation slug | |
| branch | Yes | Branch name (not a pattern) | |
| allow_deletion | No | ||
| require_pr_run | No | Workflow checks count only from the PR's pull_request run | |
| required_checks | No | Array of check names that must pass (workflow names, gate names or commit-status contexts); [] clears the list | |
| allow_force_push | No | ||
| enable_auto_merge | No | Branch-wide autopilot auto-merge (K2) | |
| required_approvals | No | Human approvals required (0-10) | |
| require_ai_approval | No | ||
| require_green_gates | No | ||
| require_human_review | No | ||
| require_pull_request | No | ||
| dismiss_stale_reviews | No |