repos

Get rules for a branch

Returns all active rules that apply to the specified branch. The branch does not need to exist; rules that would apply to a branch with that name will be returned. All active rules that apply will be returned, regardless of the level at which they are configured (e.g. repository or organization). Rules in rulesets with "evaluate" or "disabled" enforcement statuses are not returned.

get/repos/{owner}/{repo}/rules/branches/{branch}

Path parameters

ownerstring required

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

repostring required

The name of the repository without the .git extension. The name is not case sensitive.

branchstring required

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

Query parameters

per_pageinteger

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

pageinteger

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Response

Response

Changes

Changed in 2 of the 62 revisions of this API.11

  • 2022-11-280bd000ee5faf1See the full diff
    • added the optional property items/oneOf[subschema #8]/allOf[subschema #1: pull_request]/parameters/dismissal_restriction to the response with the 200 status

      response-optional-property-added

  • 2022-11-28a016096aa2cb1See the full diff
    • added subschema #19 to the items/ response property oneOf list for the response status 200

      response-property-one-of-added

Of the 62 revisions, 1 has no diff computed.