Skip to content

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.

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 os
from alter_sdk import App
from 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()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.orgstringRequired within parent
path.rule_suite_idintegerRequired within parent
queryobjectOptionalAdditional keys: not allowed
query.include_metadatabooleanOptionalDefault: false

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Get a repository rule suite — response body

Referenced models: Get a repository rule suite — response body

1 more schema is linked from the tables above, on the schema pages.

Get a repository rule suite — response body
FieldTypePresenceDescription and constraints
$objectRootResponse
actor_idJSONOptional
actor_id (anyOf 1)JSONAlternative
actor_id (anyOf 1) (anyOf 1)integerAlternativeThe number that identifies the user.
actor_id (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
actor_id (anyOf 2)nullAlternative
actor_nameJSONOptional
actor_name (anyOf 1)stringAlternativeThe handle for the GitHub user account.
actor_name (anyOf 2)nullAlternative
after_shastringOptionalThe new commit SHA of the ref.
before_shastringOptionalThe previous commit SHA of the ref.
evaluation_resultJSONOptional
evaluation_result (anyOf 1)stringAlternativeThe 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)nullAlternative
idJSONOptional
id (anyOf 1)integerAlternativeThe unique identifier of the rule insight.
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
pushed_atstringOptionalFormat: date-time
refstringOptionalThe ref name that the evaluation ran on.
repository_idJSONOptional
repository_id (anyOf 1)integerAlternativeThe ID of the repository associated with the rule evaluation.
repository_id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
repository_namestringOptionalThe name of the repository without the `.git` extension.
resultstringOptionalThe result of the rule evaluations for rules with the `active` enforcement status.
Known values: pass, fail, bypass
rule_evaluationsarrayOptionalDetails on the evaluated rules.
rule_evaluations[]objectEach item
rule_evaluations[].detailsJSONOptional
rule_evaluations[].details (anyOf 1)stringAlternativeThe detailed failure message for the rule. Null if the rule passed.
rule_evaluations[].details (anyOf 2)nullAlternative
rule_evaluations[].enforcementstringOptionalThe enforcement level of this rule source.
Known values: active, evaluate, deleted ruleset
rule_evaluations[].metadataJSONOptional
rule_evaluations[].metadata (anyOf 1)objectAlternativeAdditional 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)ModelAlternativeExpand 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)ModelAlternativeExpand 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)nullAlternative
rule_evaluations[].resultstringOptionalThe result of the evaluation of the individual rule.
Known values: pass, fail
rule_evaluations[].rule_sourceobjectOptional
rule_evaluations[].rule_source.idJSONOptional
rule_evaluations[].rule_source.id (anyOf 1)JSONAlternative
rule_evaluations[].rule_source.id (anyOf 1) (anyOf 1)integerAlternativeThe ID of the rule source.
rule_evaluations[].rule_source.id (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
rule_evaluations[].rule_source.id (anyOf 2)nullAlternative
rule_evaluations[].rule_source.nameJSONOptional
rule_evaluations[].rule_source.name (anyOf 1)stringAlternativeThe name of the rule source.
rule_evaluations[].rule_source.name (anyOf 2)nullAlternative
rule_evaluations[].rule_source.typestringOptionalThe type of rule source.
rule_evaluations[].rule_typestringOptionalThe 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
FieldTypePresenceDescription and constraints
$objectRootMetadata for a pull request rule evaluation result.
pull_requestobjectOptionalThe pull request associated with the rule evaluation.
pull_request.idJSONOptional
pull_request.id (anyOf 1)integerAlternativeThe unique identifier of the pull request.
pull_request.id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
pull_request.numberJSONOptional
pull_request.number (anyOf 1)integerAlternativeThe number of the pull request.
pull_request.number (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
pull_request.proof_of_presenceJSONOptional
pull_request.proof_of_presence (anyOf 1)objectAlternativeThe proof of presence evaluation for the pull request. Null if proof of presence was not evaluated.
pull_request.proof_of_presence (anyOf 1).base_shastringOptionalThe base commit SHA the proof of presence evaluation applies to. Empty if unavailable.
pull_request.proof_of_presence (anyOf 1).codestringOptionalA code describing the reason for the proof of presence state.
pull_request.proof_of_presence (anyOf 1).head_shastringOptionalThe head commit SHA the proof of presence evaluation applies to. Empty if unavailable.
pull_request.proof_of_presence (anyOf 1).required_levelstringOptionalThe authentication level required by the rule. Empty if unavailable.
pull_request.proof_of_presence (anyOf 1).statestringOptionalThe state of the proof of presence evaluation.
pull_request.proof_of_presence (anyOf 1).verified_atstringOptionalThe 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_levelstringOptionalThe authentication level that was verified. Empty if proof of presence has not been completed.
pull_request.proof_of_presence (anyOf 1).verifierJSONOptional
pull_request.proof_of_presence (anyOf 1).verifier (anyOf 1)objectAlternativeThe user who provided proof of presence. Null if no proof of presence was recorded.
pull_request.proof_of_presence (anyOf 1).verifier (anyOf 1).idJSONOptional
pull_request.proof_of_presence (anyOf 1).verifier (anyOf 1).id (anyOf 1)integerAlternativeThe unique identifier of the user.
pull_request.proof_of_presence (anyOf 1).verifier (anyOf 1).id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
pull_request.proof_of_presence (anyOf 1).verifier (anyOf 1).loginstringOptionalThe handle for the GitHub user account.
pull_request.proof_of_presence (anyOf 1).verifier (anyOf 1).typestringOptionalThe type of the user.
pull_request.proof_of_presence (anyOf 1).verifier (anyOf 2)nullAlternative
pull_request.proof_of_presence (anyOf 2)nullAlternative
pull_request.reviewsarrayOptionalThe reviews associated with the pull request.
pull_request.reviews[]objectEach item
pull_request.reviews[].idJSONOptional
pull_request.reviews[].id (anyOf 1)integerAlternativeThe unique identifier of the review.
pull_request.reviews[].id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
pull_request.reviews[].statestringOptionalThe state of the review.
pull_request.reviews[].userobjectOptionalThe user who submitted the review.
pull_request.reviews[].user.idJSONOptional
pull_request.reviews[].user.id (anyOf 1)integerAlternativeThe unique identifier of the user.
pull_request.reviews[].user.id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
pull_request.reviews[].user.loginstringOptionalThe handle for the GitHub user account.
pull_request.reviews[].user.typestringOptionalThe type of the user.
pull_request.userobjectOptionalThe user who created the pull request.
pull_request.user.idJSONOptional
pull_request.user.id (anyOf 1)integerAlternativeThe unique identifier of the user.
pull_request.user.id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
pull_request.user.loginstringOptionalThe handle for the GitHub user account.
pull_request.user.typestringOptionalThe type of the user.

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

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.