Add required signatures of protected branch

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.

Note: 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

Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact your GitHub Enterprise site administrator.

When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits.

POST /repos/:owner/:repo/branches/:branch/protection/required_signatures

Response

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