GitHub: Get an organization Actions policy
GitHub actions.actionsGetOrgActionsPolicy: arguments, response, policy and SDK examples.
← Actions operations · Get started
Operation github.actions_get_org_actions_policy
Provider route: GET /orgs/{org}/actions/policies/{policy_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["actions"]["actionsGetOrgActionsPolicy"]>[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.actions.actionsGetOrgActionsPolicy(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.actions.actions_get_org_actions_policy(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.policy_id | integer | Required within parent |
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 Actions policy — response body |
Referenced models: Get a repository Actions policy — response body
Schemas
Section titled “Schemas”15 more schemas are linked from the tables above, on the schema pages.
Get a repository Actions policy — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | An Actions policy defines rules for workflow execution protection. |
_links | object | Optional | |
_links.html | object | Optional | |
_links.html.href | string | Optional | The html URL of the policy |
_links.self | object | Optional | |
_links.self.href | string | Optional | The URL of the policy |
conditions | JSON | Optional | |
conditions (anyOf 1) | JSON | Alternative | When workflow path targeting is available, detailed responses represent an omitted stored workflow condition as `workflow_path` with `include` set to `["~ALL"]` and `exclude` set to `[]`. When workflow path targeting is unavailable, an omitted stored condition remains omitted. |
conditions (anyOf 1) (anyOf 1) | Model | Alternative | Expand Get a repository Actions policy — response body — conditions value Repository Actions policy conditions |
conditions (anyOf 1) (anyOf 2) | Model | Alternative | Expand Get a repository Actions policy — response body — conditions value Organization Actions policy conditions |
conditions (anyOf 1) (anyOf 3) | Model | Alternative | Expand Get a repository Actions policy — response body — conditions value Enterprise Actions policy conditions |
conditions (anyOf 2) | null | Alternative | |
created_at | string | Optional | Format: date-time |
enforcement | string | Required within parent | The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). Known values: disabled, active, evaluate |
id | JSON | Required within parent | |
id (anyOf 1) | integer | Alternative | The ID of the policy |
id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
name | string | Required within parent | The name of the policy |
node_id | string | Optional | |
rules | array | Optional | An array of rules within the policy |
rules[] | Model | Each item | Expand Get a repository Actions policy — response body — rules item |
source | string | Required within parent | The name of the source |
source_type | string | Required within parent | The type of the source of the policy Known values: Repository, Organization, Enterprise |
target | string | Required within parent | The target of the policy Known values: actions |
updated_at | string | Optional | Format: date-time |
Referenced models: Get a repository Actions policy — response body — conditions value Enterprise Actions policy conditions, Get a repository Actions policy — response body — conditions value Organization Actions policy conditions, Get a repository Actions policy — response body — conditions value Repository Actions policy conditions, Get a repository Actions policy — response body — rules item
Get a repository Actions policy — response body — conditions value Enterprise Actions policy conditions
Referenced models: Create a repository Actions policy — request body — body conditions workflow path Actions policy workflow path condition, Get a repository Actions policy — response body — conditions value Enterprise Actions policy conditions organization id, repository name, workflow path Repository ruleset conditions for organization I Ds, Get a repository Actions policy — response body — conditions value Enterprise Actions policy conditions organization name, repository name, workflow path Repository ruleset conditions for organization names, Get a repository Actions policy — response body — conditions value Enterprise Actions policy conditions organization property, repository name, workflow path Repository ruleset conditions for organization properties, Create an organization Actions policy — request body — body conditions repository name, workflow path Repository ruleset conditions for repository names, Get a repository Actions policy — response body — conditions value Organization Actions policy conditions repository property, workflow path Repository ruleset conditions for repository properties
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: github.actions_get_org_actions_policy. Catalog operation: actions/get-org-actions-policy. 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"}