GitHub: List repository rule suites
GitHub repos.reposGetRepoRuleSuites: arguments, response, policy and SDK examples.
← Repos operations · Get started
Operation github.repos_get_repo_rule_suites
Provider route: GET /repos/{owner}/{repo}/rulesets/rule-suites. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/github with npm, or alter-sdk-github with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { GitHubIntegration } from "@alter-ai/github";
async function execute(input: Parameters<GitHubIntegration["repos"]["reposGetRepoRuleSuites"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new GitHubIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.repos.reposGetRepoRuleSuites(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_github import GitHubIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = GitHubIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.repos.repos_get_repo_rule_suites(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.owner | string | Required within parent | |
path.repo | string | Required within parent | |
query | object | Optional | Additional keys: not allowed |
query.ref | string | Optional | |
query.time_period | string | Optional | Default: day One of: hour, day, week, month |
query.actor_name | string | Optional | |
query.rule_suite_result | string | Optional | Default: all One of: pass, fail, bypass, all |
query.evaluate_status | string | Optional | Default: all One of: all, active, evaluate |
query.per_page | integer | Optional | Default: 30 |
query.page | integer | Optional | Default: 1 |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand List repository rule suites — response body |
Referenced models: List repository rule suites — response body
Schemas
Section titled “Schemas”List repository rule suites — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | array | Root | Response |
$[] | object | Each item | |
$[].actor_id | JSON | Optional | |
$[].actor_id (anyOf 1) | integer | Alternative | The number that identifies the user. |
$[].actor_id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
$[].actor_name | string | Optional | The handle for the GitHub user account. |
$[].after_sha | string | Optional | The last commit sha in the push evaluation. |
$[].before_sha | string | Optional | The first commit sha before the push evaluation. |
$[].evaluation_result | string | Optional | 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`. Known values: pass, fail, bypass |
$[].id | JSON | Optional | |
$[].id (anyOf 1) | integer | Alternative | The unique identifier of the rule insight. |
$[].id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
$[].pushed_at | string | Optional | Format: date-time |
$[].ref | string | Optional | The ref name that the evaluation ran on. |
$[].repository_id | JSON | Optional | |
$[].repository_id (anyOf 1) | integer | Alternative | The ID of the repository associated with the rule evaluation. |
$[].repository_id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
$[].repository_name | string | Optional | The name of the repository without the `.git` extension. |
$[].result | string | Optional | The result of the rule evaluations for rules with the `active` enforcement status. Known values: pass, fail, bypass |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: github.repos_get_repo_rule_suites. Catalog operation: repos/get-repo-rule-suites. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Pinned headers: {"X-GitHub-Api-Version": "2026-03-10", "User-Agent": "Alter", "Accept": "application/vnd.github+json"}