GitHub: Get an organization rule suite
GitHub repos.reposGetOrgRuleSuite: arguments, response, policy and SDK examples.
← Repos operations · Get started
Operation github.repos_get_org_rule_suite
Provider route: GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}. 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"]["reposGetOrgRuleSuite"]>[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.reposGetOrgRuleSuite(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_org_rule_suite(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.org | string | Required within parent | |
path.rule_suite_id | integer | Required within parent | |
query | object | Optional | Additional keys: not allowed |
query.include_metadata | boolean | Optional | Default: false |
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 Get a repository rule suite — response body |
Referenced models: Get a repository rule suite — response body
Schemas
Section titled “Schemas”1 more schema is linked from the tables above, on the schema pages.
Get a repository rule suite — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Response |
actor_id | JSON | Optional | |
actor_id (anyOf 1) | JSON | Alternative | |
actor_id (anyOf 1) (anyOf 1) | integer | Alternative | The number that identifies the user. |
actor_id (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
actor_id (anyOf 2) | null | Alternative | |
actor_name | JSON | Optional | |
actor_name (anyOf 1) | string | Alternative | The handle for the GitHub user account. |
actor_name (anyOf 2) | null | Alternative | |
after_sha | string | Optional | The new commit SHA of the ref. |
before_sha | string | Optional | The previous commit SHA of the ref. |
evaluation_result | JSON | Optional | |
evaluation_result (anyOf 1) | string | Alternative | 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. Known values: pass, fail, bypass |
evaluation_result (anyOf 2) | null | Alternative | |
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 |
rule_evaluations | array | Optional | Details on the evaluated rules. |
rule_evaluations[] | object | Each item | |
rule_evaluations[].details | JSON | Optional | |
rule_evaluations[].details (anyOf 1) | string | Alternative | The detailed failure message for the rule. Null if the rule passed. |
rule_evaluations[].details (anyOf 2) | null | Alternative | |
rule_evaluations[].enforcement | string | Optional | The enforcement level of this rule source. Known values: active, evaluate, deleted ruleset |
rule_evaluations[].metadata | JSON | Optional | |
rule_evaluations[].metadata (anyOf 1) | object | Alternative | Additional metadata about the rule evaluation. discriminator: {"mapping": {"pull_request": "#/components/schemas/rule-suite-pull-request", "required_status_checks": "#/components/schemas/rule-suite-required-status-checks"}, "propertyName": "rule_type"} |
rule_evaluations[].metadata (anyOf 1) (anyOf 1) | Model | Alternative | Expand Get a repository rule suite — response body — rule evaluations item metadata Additional metadata about the rule evaluation Pull request rule suite metadata |
rule_evaluations[].metadata (anyOf 1) (anyOf 2) | Model | Alternative | Expand Get a repository rule suite — response body — rule evaluations item metadata Additional metadata about the rule evaluation Required status checks rule suite metadata |
rule_evaluations[].metadata (anyOf 2) | null | Alternative | |
rule_evaluations[].result | string | Optional | The result of the evaluation of the individual rule. Known values: pass, fail |
rule_evaluations[].rule_source | object | Optional | |
rule_evaluations[].rule_source.id | JSON | Optional | |
rule_evaluations[].rule_source.id (anyOf 1) | JSON | Alternative | |
rule_evaluations[].rule_source.id (anyOf 1) (anyOf 1) | integer | Alternative | The ID of the rule source. |
rule_evaluations[].rule_source.id (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
rule_evaluations[].rule_source.id (anyOf 2) | null | Alternative | |
rule_evaluations[].rule_source.name | JSON | Optional | |
rule_evaluations[].rule_source.name (anyOf 1) | string | Alternative | The name of the rule source. |
rule_evaluations[].rule_source.name (anyOf 2) | null | Alternative | |
rule_evaluations[].rule_source.type | string | Optional | The type of rule source. |
rule_evaluations[].rule_type | string | Optional | The type of rule. |
Referenced models: Get a repository rule suite — response body — rule evaluations item metadata Additional metadata about the rule evaluation Pull request rule suite metadata, Get a repository rule suite — response body — rule evaluations item metadata Additional metadata about the rule evaluation Required status checks rule suite metadata
Get a repository rule suite — response body — rule evaluations item metadata Additional metadata about the rule evaluation Pull request rule suite metadata
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Metadata for a pull request rule evaluation result. |
pull_request | object | Optional | The pull request associated with the rule evaluation. |
pull_request.id | JSON | Optional | |
pull_request.id (anyOf 1) | integer | Alternative | The unique identifier of the pull request. |
pull_request.id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
pull_request.number | JSON | Optional | |
pull_request.number (anyOf 1) | integer | Alternative | The number of the pull request. |
pull_request.number (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
pull_request.proof_of_presence | JSON | Optional | |
pull_request.proof_of_presence (anyOf 1) | object | Alternative | The proof of presence evaluation for the pull request. Null if proof of presence was not evaluated. |
pull_request.proof_of_presence (anyOf 1).base_sha | string | Optional | The base commit SHA the proof of presence evaluation applies to. Empty if unavailable. |
pull_request.proof_of_presence (anyOf 1).code | string | Optional | A code describing the reason for the proof of presence state. |
pull_request.proof_of_presence (anyOf 1).head_sha | string | Optional | The head commit SHA the proof of presence evaluation applies to. Empty if unavailable. |
pull_request.proof_of_presence (anyOf 1).required_level | string | Optional | The authentication level required by the rule. Empty if unavailable. |
pull_request.proof_of_presence (anyOf 1).state | string | Optional | The state of the proof of presence evaluation. |
pull_request.proof_of_presence (anyOf 1).verified_at | string | Optional | The time proof of presence was verified, in ISO 8601 format. Empty if proof of presence has not been completed. |
pull_request.proof_of_presence (anyOf 1).verified_level | string | Optional | The authentication level that was verified. Empty if proof of presence has not been completed. |
pull_request.proof_of_presence (anyOf 1).verifier | JSON | Optional | |
pull_request.proof_of_presence (anyOf 1).verifier (anyOf 1) | object | Alternative | The user who provided proof of presence. Null if no proof of presence was recorded. |
pull_request.proof_of_presence (anyOf 1).verifier (anyOf 1).id | JSON | Optional | |
pull_request.proof_of_presence (anyOf 1).verifier (anyOf 1).id (anyOf 1) | integer | Alternative | The unique identifier of the user. |
pull_request.proof_of_presence (anyOf 1).verifier (anyOf 1).id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
pull_request.proof_of_presence (anyOf 1).verifier (anyOf 1).login | string | Optional | The handle for the GitHub user account. |
pull_request.proof_of_presence (anyOf 1).verifier (anyOf 1).type | string | Optional | The type of the user. |
pull_request.proof_of_presence (anyOf 1).verifier (anyOf 2) | null | Alternative | |
pull_request.proof_of_presence (anyOf 2) | null | Alternative | |
pull_request.reviews | array | Optional | The reviews associated with the pull request. |
pull_request.reviews[] | object | Each item | |
pull_request.reviews[].id | JSON | Optional | |
pull_request.reviews[].id (anyOf 1) | integer | Alternative | The unique identifier of the review. |
pull_request.reviews[].id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
pull_request.reviews[].state | string | Optional | The state of the review. |
pull_request.reviews[].user | object | Optional | The user who submitted the review. |
pull_request.reviews[].user.id | JSON | Optional | |
pull_request.reviews[].user.id (anyOf 1) | integer | Alternative | The unique identifier of the user. |
pull_request.reviews[].user.id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
pull_request.reviews[].user.login | string | Optional | The handle for the GitHub user account. |
pull_request.reviews[].user.type | string | Optional | The type of the user. |
pull_request.user | object | Optional | The user who created the pull request. |
pull_request.user.id | JSON | Optional | |
pull_request.user.id (anyOf 1) | integer | Alternative | The unique identifier of the user. |
pull_request.user.id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
pull_request.user.login | string | Optional | The handle for the GitHub user account. |
pull_request.user.type | string | Optional | The type of the user. |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: github.repos_get_org_rule_suite. Catalog operation: repos/get-org-rule-suite. 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"}