Skip to main content

branch_protection

Overview

Namebranch_protection
TypeResource
Idgithub.repos.branch_protection

Fields

NameDatatypeDescription
namestring
protection_urlstring
allow_deletionsobject
restrictionsobjectBranch Restriction Policy
allow_force_pushesobject
required_signaturesobject
urlstring
required_status_checksobjectProtected Branch Required Status Check
enforce_adminsobjectProtected Branch Admin Enforced
required_pull_request_reviewsobjectProtected Branch Pull Request Review
enabledboolean
required_conversation_resolutionobject
required_linear_historyobject

Methods

NameAccessible byRequired ParamsDescription
get_branch_protectionSELECTbranch, owner, repoProtected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
delete_branch_protectionDELETEbranch, owner, repoProtected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
update_branch_protectionEXECbranch, owner, repo, data__enforce_admins, data__required_pull_request_reviews, data__required_status_checks, data__restrictionsProtected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.

Protecting a branch requires admin or owner permissions to the repository.

Note: Passing new arrays of users and teams replaces their previous values.

Note: The list of users, apps, and teams in total is limited to 100 items.