Github API - Test Config

PUT /repos/{owner}/{repo}/branches/{branch}/protection
repos

Protected 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.
Update branch protection

Arguments
key owner

owner [scalar]

The account owner of the repository. The name is not case sensitive.

API:
Github Open API
(version: 1.1.4)

key repo

repo [scalar]

The name of the repository. The name is not case sensitive.

API:
Github Open API
(version: 1.1.4)

key branch

branch [scalar]

The name of the branch. Cannot contain wildcard characters. To use wildcard characters in branch names, use the GraphQL API.

API:
Github Open API
(version: 1.1.4)

Returns
200 application/json protected-branch

protected-branch [object]

Branch protections protect branches

Attributes
allow_deletions 2053

allow_force_pushes 2054

allow_fork_syncing 2055

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.

block_creations 2056

enforce_admins 2057

lock_branch 2058

Whether to set the branch as read-only. If this is true, users will not be able to push to the branch.

required_conversation_resolution 2059

required_linear_history 2060

required_pull_request_reviews 2061

required_signatures 2064

required_status_checks status-check-policy

url string

API:
Github Open API
(version: 1.1.4)
403 forbidden

forbidden [scalar]

Forbidden

API:
Github Open API
(version: 1.1.4)
404 not_found

not_found [scalar]

Resource not found

API:
Github Open API
(version: 1.1.4)
422 validation_failed_simple

validation_failed_simple [scalar]

Validation failed, or the endpoint has been spammed.

API:
Github Open API
(version: 1.1.4)
API:
Github Open API
(version: 1.1.4)