Skip to main content

rule_suites

Creates, updates, deletes, gets or lists a rule_suites resource.

Overview

Namerule_suites
TypeResource
Idgithub.repos.rule_suites

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idintegerThe unique identifier of the rule insight.
actor_idintegerThe number that identifies the user.
repository_idintegerThe ID of the repository associated with the rule evaluation.
actor_namestringThe handle for the GitHub user account.
repository_namestringThe name of the repository without the .git extension.
after_shastringThe new commit SHA of the ref.
before_shastringThe previous commit SHA of the ref.
evaluation_resultstringThe 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. (pass, fail, bypass)
pushed_atstring (date-time) (example: 2011-01-26T19:06:43Z)
refstringThe ref name that the evaluation ran on.
resultstringThe result of the rule evaluations for rules with the active enforcement status. (pass, fail, bypass)
rule_evaluationsarrayDetails on the evaluated rules.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_repo_rule_suiteselectowner, repo, rule_suite_idGets information about a suite of rule evaluations from within a repository.
For more information, see "Managing rulesets for a repository."
get_org_rule_suiteselectorg, rule_suite_idGets information about a suite of rule evaluations from within an organization.
For more information, see "Managing rulesets for repositories in your organization."
get_repo_rule_suitesselectowner, reporef, time_period, actor_name, rule_suite_result, per_page, pageLists suites of rule evaluations at the repository level.
For more information, see "Managing rulesets for a repository."
get_org_rule_suitesselectorgref, repository_name, time_period, actor_name, rule_suite_result, per_page, pageLists suites of rule evaluations at the organization level.
For more information, see "Managing rulesets for repositories in your organization."

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
orgstringThe organization name. The name is not case sensitive.
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.
rule_suite_idintegerThe 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.
actor_namestringThe handle for the GitHub user account to filter on. When specified, only rule evaluations triggered by this actor will be returned.
pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
refstringThe 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_namestringThe name of the repository to filter on.
rule_suite_resultstringThe rule suite results to filter on. When specified, only suites with this result will be returned.
time_periodstringThe 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).

SELECT examples

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

SELECT
id,
actor_id,
repository_id,
actor_name,
repository_name,
after_sha,
before_sha,
evaluation_result,
pushed_at,
ref,
result,
rule_evaluations
FROM github.repos.rule_suites
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND rule_suite_id = '{{ rule_suite_id }}' -- required
;