Skip to content

List organization rule suites

GET
/orgs/{org}/rulesets/rule-suites

Lists suites of rule evaluations at the organization level. For more information, see “Managing rulesets for repositories in your organization.”

API method documentation

org
required
string

The organization name. The name is not case sensitive.

ref
string

The name of the ref. Cannot contain wildcard characters. Optionally prefix with refs/heads/ to limit to branches or refs/tags/ to limit to tags. Omit the prefix to search across all refs. When specified, only rule evaluations triggered for this ref will be returned.

repository_name
string

The name of the repository to filter on.

time_period
string
default: day
Allowed values: hour day week month

The time period to filter by.

For example, day will filter for rule suites that occurred in the past 24 hours, and week will filter for rule suites that occurred in the past 7 days (168 hours).

actor_name
string

The handle for the GitHub user account to filter on. When specified, only rule evaluations triggered by this actor will be returned.

rule_suite_result
string
default: all
Allowed values: pass fail bypass all

The rule suite results to filter on. When specified, only suites with this result will be returned.

evaluate_status
string
default: all
Allowed values: all active evaluate

The evaluate status to filter on. When specified, only rule suites resulting from rulesets with the specified evaluate status will be returned.

  • all - all rule suites will be returned.
  • active - only rule suites resulting from rulesets in active (non-evaluate) mode will be returned.
  • evaluate - only rule suites resulting from rulesets in evaluate mode will be returned.
per_page
integer
default: 30

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

page
integer
default: 1

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

Response

Media type application/json
Rule Suites

Response

Array<object>
object
id

The unique identifier of the rule insight.

integer
actor_id

The number that identifies the user.

integer
actor_name

The handle for the GitHub user account.

string
before_sha

The first commit sha before the push evaluation.

string
after_sha

The last commit sha in the push evaluation.

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.

string
Allowed values: pass fail bypass
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"
},
{
"id": 25,
"actor_id": 11,
"actor_name": "not-octocat",
"before_sha": "48994e4e01ccc943624c6231f172702b82b233cc",
"after_sha": "ecfd5a1025fa271a33ca5608d089476a2df3c9a1",
"ref": "refs/heads/i-am-everything",
"repository_id": 404,
"repository_name": "octo-repo",
"pushed_at": "2023-07-07T08:43:03Z",
"result": "pass",
"evaluation_result": "fail"
}
]

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"
}