Skip to content

Get a repository rule suite

GET
/repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}

Gets information about a suite of rule evaluations from within a repository. For more information, see “Managing rulesets for a repository.”

API method documentation

owner
required
string

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

repo
required
string

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

rule_suite_id
required
integer

The unique identifier of the rule suite result. To get this ID, you can use GET /repos/{owner}/{repo}/rulesets/rule-suites for repositories and GET /orgs/{org}/rulesets/rule-suites for organizations.

Response

Media type application/json
Rule Suite

Response

object
id

The unique identifier of the rule insight.

integer
actor_id

The number that identifies the user.

integer
nullable
actor_name

The handle for the GitHub user account.

string
nullable
before_sha

The previous commit SHA of the ref.

string
after_sha

The new commit SHA of the ref.

string
ref

The ref name that the evaluation ran on.

string
repository_id

The ID of the repository associated with the rule evaluation.

integer
repository_name

The name of the repository without the .git extension.

string
pushed_at
string format: date-time
result

The result of the rule evaluations for rules with the active enforcement status.

string
Allowed values: pass fail bypass
evaluation_result

The result of the rule evaluations for rules with the active and evaluate enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were active. Null if no rules with evaluate enforcement status were run.

string
nullable
Allowed values: pass fail bypass
rule_evaluations

Details on the evaluated rules.

Array<object>
object
rule_source
object
type

The type of rule source.

string
id

The ID of the rule source.

integer
nullable
name

The name of the rule source.

string
nullable
enforcement

The enforcement level of this rule source.

string
Allowed values: active evaluate deleted ruleset
result

The result of the evaluation of the individual rule.

string
Allowed values: pass fail
rule_type

The type of rule.

string
details

The detailed failure message for the rule. Null if the rule passed.

string
nullable
Examples
Example default
{
"id": 21,
"actor_id": 12,
"actor_name": "octocat",
"before_sha": "893f768e172fb1bc9c5d6f3dd48557e45f14e01d",
"after_sha": "dedd88641a362b6b4ea872da4847d6131a164d01",
"ref": "refs/heads/i-see-everything",
"repository_id": 404,
"repository_name": "octo-repo",
"pushed_at": "2023-07-06T08:43:03Z",
"result": "bypass",
"evaluation_result": "fail",
"rule_evaluations": [
{
"rule_source": {
"type": "ruleset",
"id": 2,
"name": "Author email must be a GitHub email address"
},
"enforcement": "active",
"result": "pass",
"rule_type": "commit_author_email_pattern"
},
{
"rule_source": {
"type": "protected_branch"
},
"enforcement": "active",
"result": "fail",
"rule_type": "pull_request",
"details": "Changes must be made through a pull request."
},
{
"rule_source": {
"type": "ruleset",
"id": 3,
"name": "Evaluate commit message pattern"
},
"enforcement": "evaluate",
"result": "fail",
"rule_type": "commit_message_pattern"
}
]
}

Resource not found

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Internal Error

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}