{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "#/components/schemas/protected-branch", "title": "Protected Branch", "description": "Branch protections protect branches", "type": "object", "properties": { "url": { "type": "string", "format": "uri" }, "required_status_checks": { "$ref": "#/components/schemas/status-check-policy" }, "required_pull_request_reviews": { "type": "object", "properties": { "url": { "type": "string", "format": "uri" }, "dismiss_stale_reviews": { "type": "boolean" }, "require_code_owner_reviews": { "type": "boolean" }, "required_approving_review_count": { "type": "integer" }, "require_last_push_approval": { "description": "Whether the most recent push must be approved by someone other than the person who pushed it.", "type": "boolean", "default": false }, "dismissal_restrictions": { "type": "object", "properties": { "url": { "type": "string", "format": "uri" }, "users_url": { "type": "string", "format": "uri" }, "teams_url": { "type": "string", "format": "uri" }, "users": { "type": "array", "items": { "$ref": "#/components/schemas/simple-user" } }, "teams": { "type": "array", "items": { "$ref": "#/components/schemas/team" } }, "apps": { "type": "array", "items": { "$ref": "#/components/schemas/integration" } } }, "required": [ "url", "users_url", "teams_url", "users", "teams" ] }, "bypass_pull_request_allowances": { "type": "object", "properties": { "users": { "type": "array", "items": { "$ref": "#/components/schemas/simple-user" } }, "teams": { "type": "array", "items": { "$ref": "#/components/schemas/team" } }, "apps": { "type": "array", "items": { "$ref": "#/components/schemas/integration" } } }, "required": [ "users", "teams" ] } }, "required": [ "url" ] }, "required_signatures": { "type": "object", "properties": { "url": { "type": "string", "format": "uri", "example": "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_signatures" }, "enabled": { "type": "boolean", "example": true } }, "required": [ "url", "enabled" ] }, "enforce_admins": { "type": "object", "properties": { "url": { "type": "string", "format": "uri" }, "enabled": { "type": "boolean" } }, "additionalProperties": false, "required": [ "url", "enabled" ] }, "required_linear_history": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "additionalProperties": false, "required": [ "enabled" ] }, "allow_force_pushes": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "additionalProperties": false, "required": [ "enabled" ] }, "allow_deletions": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "additionalProperties": false, "required": [ "enabled" ] }, "restrictions": { "$ref": "#/components/schemas/branch-restriction-policy" }, "required_conversation_resolution": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "additionalProperties": false }, "block_creations": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "additionalProperties": false, "required": [ "enabled" ] }, "lock_branch": { "type": "object", "description": "Whether to set the branch as read-only. If this is true, users will not be able to push to the branch.", "properties": { "enabled": { "default": false, "type": "boolean" } }, "additionalProperties": false }, "allow_fork_syncing": { "type": "object", "description": "Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing.", "properties": { "enabled": { "default": false, "type": "boolean" } }, "additionalProperties": false } }, "required": [ "url" ] }