octokit.rest

Get commit signature protection

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.

When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of true indicates you must sign commits on this branch. For more information, see Signing commits with GPG in GitHub Help.

Note: You must enable branch protection to require signed commits.

zzzax Preview (required)

Protected Branches API can now manage a setting for requiring signed commits. This feature is currently available for developers to preview. See the blog post for full details. To access the API during the preview period, you must provide a custom media type in the Accept header:

application/vnd.github.zzzax-preview+json

Parameters

string The token will be passed in the authorization header.

string

string

string branch+ parameter

Request

GET https://api.github.com/repos///branches//protection/required_signatures
authorization: bearer undefined
accept: application/vnd.github.v3+json
user-agent: octokit.rest


Example Response

Status: 200
{
  "url": "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_signatures",
  "enabled": true
}

See documentation on GitHub developer guides