rule_suites
Creates, updates, deletes, gets or lists a rule_suites resource.
Overview
| Name | rule_suites |
| Type | Resource |
| Id | github.repos.rule_suites |
Fields
The following fields are returned by SELECT queries:
- get_repo_rule_suite
- get_org_rule_suite
- get_repo_rule_suites
- get_org_rule_suites
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The unique identifier of the rule insight. |
actor_id | integer | The number that identifies the user. |
repository_id | integer | The ID of the repository associated with the rule evaluation. |
actor_name | string | The handle for the GitHub user account. |
repository_name | string | The name of the repository without the .git extension. |
after_sha | string | The new commit SHA of the ref. |
before_sha | string | The previous commit SHA of the ref. |
evaluation_result | string | 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. (pass, fail, bypass) |
pushed_at | string (date-time) | (example: 2011-01-26T19:06:43Z) |
ref | string | The ref name that the evaluation ran on. |
result | string | The result of the rule evaluations for rules with the active enforcement status. (pass, fail, bypass) |
rule_evaluations | array | Details on the evaluated rules. |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The unique identifier of the rule insight. |
actor_id | integer | The number that identifies the user. |
repository_id | integer | The ID of the repository associated with the rule evaluation. |
actor_name | string | The handle for the GitHub user account. |
repository_name | string | The name of the repository without the .git extension. |
after_sha | string | The new commit SHA of the ref. |
before_sha | string | The previous commit SHA of the ref. |
evaluation_result | string | 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. (pass, fail, bypass) |
pushed_at | string (date-time) | (example: 2011-01-26T19:06:43Z) |
ref | string | The ref name that the evaluation ran on. |
result | string | The result of the rule evaluations for rules with the active enforcement status. (pass, fail, bypass) |
rule_evaluations | array | Details on the evaluated rules. |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The unique identifier of the rule insight. |
actor_id | integer | The number that identifies the user. |
repository_id | integer | The ID of the repository associated with the rule evaluation. |
actor_name | string | The handle for the GitHub user account. |
repository_name | string | The name of the repository without the .git extension. |
after_sha | string | The last commit sha in the push evaluation. |
before_sha | string | The first commit sha before the push evaluation. |
evaluation_result | string | 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. (pass, fail, bypass) |
pushed_at | string (date-time) | (example: 2011-01-26T19:06:43Z) |
ref | string | The ref name that the evaluation ran on. |
result | string | The result of the rule evaluations for rules with the active enforcement status. (pass, fail, bypass) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The unique identifier of the rule insight. |
actor_id | integer | The number that identifies the user. |
repository_id | integer | The ID of the repository associated with the rule evaluation. |
actor_name | string | The handle for the GitHub user account. |
repository_name | string | The name of the repository without the .git extension. |
after_sha | string | The last commit sha in the push evaluation. |
before_sha | string | The first commit sha before the push evaluation. |
evaluation_result | string | 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. (pass, fail, bypass) |
pushed_at | string (date-time) | (example: 2011-01-26T19:06:43Z) |
ref | string | The ref name that the evaluation ran on. |
result | string | The result of the rule evaluations for rules with the active enforcement status. (pass, fail, bypass) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_repo_rule_suite | select | owner, repo, rule_suite_id | Gets information about a suite of rule evaluations from within a repository. For more information, see "Managing rulesets for a repository." | |
get_org_rule_suite | select | org, rule_suite_id | Gets 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_suites | select | owner, repo | ref, time_period, actor_name, rule_suite_result, per_page, page | Lists suites of rule evaluations at the repository level. For more information, see "Managing rulesets for a repository." |
get_org_rule_suites | select | org | ref, repository_name, time_period, actor_name, rule_suite_result, per_page, page | Lists 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.
| Name | Datatype | Description |
|---|---|---|
org | string | The organization name. The name is not case sensitive. |
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
rule_suite_id | 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. |
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. |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
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. |
rule_suite_result | string | The rule suite results to filter on. When specified, only suites with this result will be returned. |
time_period | string | 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). |
SELECT examples
- get_repo_rule_suite
- get_org_rule_suite
- get_repo_rule_suites
- get_org_rule_suites
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
;
Gets information about a suite of rule evaluations from within an organization.
For more information, see "Managing rulesets for repositories in your organization."
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 org = '{{ org }}' -- required
AND rule_suite_id = '{{ rule_suite_id }}' -- required
;
Lists suites of rule evaluations at the repository level.
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
FROM github.repos.rule_suites
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND ref = '{{ ref }}'
AND time_period = '{{ time_period }}'
AND actor_name = '{{ actor_name }}'
AND rule_suite_result = '{{ rule_suite_result }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
Lists suites of rule evaluations at the organization level.
For more information, see "Managing rulesets for repositories in your organization."
SELECT
id,
actor_id,
repository_id,
actor_name,
repository_name,
after_sha,
before_sha,
evaluation_result,
pushed_at,
ref,
result
FROM github.repos.rule_suites
WHERE org = '{{ org }}' -- required
AND ref = '{{ ref }}'
AND repository_name = '{{ repository_name }}'
AND time_period = '{{ time_period }}'
AND actor_name = '{{ actor_name }}'
AND rule_suite_result = '{{ rule_suite_result }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;