GitHub: Get repositories associated with a code security configuration
GitHub codeSecurity.codeSecurityGetRepositoriesForConfiguration: arguments, response, policy and SDK examples.
← Code security operations · Get started
Operation github.code_security_get_repositories_for_configuration
Provider route: GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories. 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["codeSecurity"]["codeSecurityGetRepositoriesForConfiguration"]>[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.codeSecurity.codeSecurityGetRepositoriesForConfiguration(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.code_security.code_security_get_repositories_for_configuration(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.configuration_id | integer | Required within parent | |
query | object | Optional | Additional keys: not allowed |
query.per_page | integer | Optional | Default: 30 |
query.before | string | Optional | |
query.after | string | Optional | |
query.status | string | Optional | Default: all |
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 |
|---|---|---|---|
$ | array | Root | |
$[] | Model | Each item | Expand Get repositories associated with a code security configuration — response body — item |
Referenced models: Get repositories associated with a code security configuration — response body — item
Schemas
Section titled “Schemas”Get repositories associated with a code security configuration — response body — item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Repositories associated with a code security configuration and attachment status |
repository | Model | Optional | Expand List repositories for a user migration — response body — item |
status | string | Optional | The attachment status of the code security configuration on the repository. Known values: attached, attaching, detached, removed, enforced, failed, updating, removed_by_enterprise, enterprise_enforced |
Referenced models: List repositories for a user migration — response body — item
List repositories for a user migration — response body — item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A GitHub repository. |
archive_url | string | Required within parent | A template for the API URL to download the repository as an archive. |
assignees_url | string | Required within parent | A template for the API URL to list the available assignees for issues in the repository. |
blobs_url | string | Required within parent | A template for the API URL to create or retrieve a raw Git blob in the repository. |
branches_url | string | Required within parent | A template for the API URL to get information about branches in the repository. |
collaborators_url | string | Required within parent | A template for the API URL to get information about collaborators of the repository. |
comments_url | string | Required within parent | A template for the API URL to get information about comments on the repository. |
commits_url | string | Required within parent | A template for the API URL to get information about commits on the repository. |
compare_url | string | Required within parent | A template for the API URL to compare two commits or refs. |
contents_url | string | Required within parent | A template for the API URL to get the contents of the repository. |
contributors_url | string | Required within parent | A template for the API URL to list the contributors to the repository. Format: uri |
deployments_url | string | Required within parent | The API URL to list the deployments of the repository. Format: uri |
description | JSON | Required within parent | |
description (anyOf 1) | string | Alternative | The repository description. |
description (anyOf 2) | null | Alternative | |
downloads_url | string | Required within parent | The API URL to list the downloads on the repository. Format: uri |
events_url | string | Required within parent | The API URL to list the events of the repository. Format: uri |
fork | boolean | Required within parent | Whether the repository is a fork. |
forks_url | string | Required within parent | The API URL to list the forks of the repository. Format: uri |
full_name | string | Required within parent | The full, globally unique, name of the repository. |
git_commits_url | string | Required within parent | A template for the API URL to get information about Git commits of the repository. |
git_refs_url | string | Required within parent | A template for the API URL to get information about Git refs of the repository. |
git_tags_url | string | Required within parent | A template for the API URL to get information about Git tags of the repository. |
hooks_url | string | Required within parent | The API URL to list the hooks on the repository. Format: uri |
html_url | string | Required within parent | The URL to view the repository on GitHub.com. Format: uri |
id | JSON | Required within parent | |
id (anyOf 1) | integer | Alternative | A unique identifier of the repository. Format: int64 |
id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
issue_comment_url | string | Required within parent | A template for the API URL to get information about issue comments on the repository. |
issue_events_url | string | Required within parent | A template for the API URL to get information about issue events on the repository. |
issues_url | string | Required within parent | A template for the API URL to get information about issues on the repository. |
keys_url | string | Required within parent | A template for the API URL to get information about deploy keys on the repository. |
labels_url | string | Required within parent | A template for the API URL to get information about labels of the repository. |
languages_url | string | Required within parent | The API URL to get information about the languages of the repository. Format: uri |
merges_url | string | Required within parent | The API URL to merge branches in the repository. Format: uri |
milestones_url | string | Required within parent | A template for the API URL to get information about milestones of the repository. |
name | string | Required within parent | The name of the repository. |
node_id | string | Required within parent | The GraphQL identifier of the repository. |
notifications_url | string | Required within parent | A template for the API URL to get information about notifications on the repository. |
owner | Model | Required within parent | Expand List users — response body — item |
private | boolean | Required within parent | Whether the repository is private. |
pulls_url | string | Required within parent | A template for the API URL to get information about pull requests on the repository. |
releases_url | string | Required within parent | A template for the API URL to get information about releases on the repository. |
stargazers_url | string | Required within parent | The API URL to list the stargazers on the repository. Format: uri |
statuses_url | string | Required within parent | A template for the API URL to get information about statuses of a commit. |
subscribers_url | string | Required within parent | The API URL to list the subscribers on the repository. Format: uri |
subscription_url | string | Required within parent | The API URL to subscribe to notifications for this repository. Format: uri |
tags_url | string | Required within parent | The API URL to get information about tags on the repository. Format: uri |
teams_url | string | Required within parent | The API URL to list the teams on the repository. Format: uri |
trees_url | string | Required within parent | A template for the API URL to create or retrieve a raw Git tree of the repository. |
url | string | Required within parent | The URL to get more information about the repository from the GitHub API. Format: uri |
Referenced models: List users — response body — item
List users — response body — item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A GitHub user. |
avatar_url | string | Required within parent | Format: uri |
email | JSON | Optional | |
email (anyOf 1) | string | Alternative | |
email (anyOf 2) | null | Alternative | |
events_url | string | Required within parent | |
followers_url | string | Required within parent | Format: uri |
following_url | string | Required within parent | |
gists_url | string | Required within parent | |
gravatar_id | JSON | Required within parent | |
gravatar_id (anyOf 1) | string | Alternative | |
gravatar_id (anyOf 2) | null | Alternative | |
html_url | string | Required within parent | Format: uri |
id | JSON | Required within parent | |
id (anyOf 1) | integer | Alternative | Format: int64 |
id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
login | string | Required within parent | |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | |
name (anyOf 2) | null | Alternative | |
node_id | string | Required within parent | |
organizations_url | string | Required within parent | Format: uri |
received_events_url | string | Required within parent | Format: uri |
repos_url | string | Required within parent | Format: uri |
site_admin | boolean | Required within parent | |
starred_at | string | Optional | |
starred_url | string | Required within parent | |
subscriptions_url | string | Required within parent | Format: uri |
type | string | Required within parent | |
url | string | Required within parent | Format: uri |
user_view_type | string | Optional |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: github.code_security_get_repositories_for_configuration. Catalog operation: code-security/get-repositories-for-configuration. 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"}