GitHub: List secret scanning alerts for a repository
GitHub secretScanning.secretScanningListAlertsForRepo: arguments, response, policy and SDK examples.
← Secret scanning operations · Get started
Operation github.secret_scanning_list_alerts_for_repo
Provider route: GET /repos/{owner}/{repo}/secret-scanning/alerts. 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["secretScanning"]["secretScanningListAlertsForRepo"]>[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.secretScanning.secretScanningListAlertsForRepo(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.secret_scanning.secret_scanning_list_alerts_for_repo(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 | Model | Optional | Expand List secret scanning alerts for a repository — request body — query |
Referenced models: List secret scanning alerts for a repository — request body — query
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 List secret scanning alerts for a repository — response body — item |
Referenced models: List secret scanning alerts for a repository — response body — item
Schemas
Section titled “Schemas”15 more schemas are linked from the tables above, on the schema pages.
List secret scanning alerts for a repository — response body — item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
assigned_to | Model | Optional | Expand Get an issue — response body — user |
closure_request_comment | JSON | Optional | |
closure_request_comment (anyOf 1) | string | Alternative | An optional comment from the closure request author. |
closure_request_comment (anyOf 2) | null | Alternative | |
closure_request_reviewer | Model | Optional | Expand Get an issue — response body — user |
closure_request_reviewer_comment | JSON | Optional | |
closure_request_reviewer_comment (anyOf 1) | string | Alternative | An optional comment from the closure request reviewer. |
closure_request_reviewer_comment (anyOf 2) | null | Alternative | |
created_at | string | Optional | The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. Format: date-time Read only: true |
first_location_detected | Model | Optional | Expand Get a secret scanning alert — response body — first location detected |
has_more_locations | boolean | Optional | A boolean value representing whether or not the token in the alert was detected in more than one location. |
html_url | string | Optional | The GitHub URL of the alert resource. Format: uri Read only: true |
is_base64_encoded | JSON | Optional | |
is_base64_encoded (anyOf 1) | boolean | Alternative | A boolean value representing whether or not alert is base64 encoded |
is_base64_encoded (anyOf 2) | null | Alternative | |
locations_url | string | Optional | The REST API URL of the code locations for this alert. Format: uri |
multi_repo | JSON | Optional | |
multi_repo (anyOf 1) | boolean | Alternative | Whether the detected secret was found in multiple repositories under the same organization or enterprise. |
multi_repo (anyOf 2) | null | Alternative | |
number | Model | Optional | Expand Get a Dependabot alert — response body — number |
provider | JSON | Optional | |
provider (anyOf 1) | string | Alternative | The provider of the secret that was detected. |
provider (anyOf 2) | null | Alternative | |
provider_slug | JSON | Optional | |
provider_slug (anyOf 1) | string | Alternative | The slug identifier for the provider of the secret that was detected. Use this value for filtering by provider with the `providers` or `exclude_providers` parameters. |
provider_slug (anyOf 2) | null | Alternative | |
publicly_leaked | JSON | Optional | |
publicly_leaked (anyOf 1) | boolean | Alternative | Whether the detected secret was publicly leaked. |
publicly_leaked (anyOf 2) | null | Alternative | |
push_protection_bypass_request_comment | JSON | Optional | |
push_protection_bypass_request_comment (anyOf 1) | string | Alternative | An optional comment when requesting a push protection bypass. |
push_protection_bypass_request_comment (anyOf 2) | null | Alternative | |
push_protection_bypass_request_html_url | JSON | Optional | |
push_protection_bypass_request_html_url (anyOf 1) | string | Alternative | The URL to a push protection bypass request. Format: uri |
push_protection_bypass_request_html_url (anyOf 2) | null | Alternative | |
push_protection_bypass_request_reviewer | Model | Optional | Expand Get an issue — response body — user |
push_protection_bypass_request_reviewer_comment | JSON | Optional | |
push_protection_bypass_request_reviewer_comment (anyOf 1) | string | Alternative | An optional comment when reviewing a push protection bypass. |
push_protection_bypass_request_reviewer_comment (anyOf 2) | null | Alternative | |
push_protection_bypassed | JSON | Optional | |
push_protection_bypassed (anyOf 1) | boolean | Alternative | Whether push protection was bypassed for the detected secret. |
push_protection_bypassed (anyOf 2) | null | Alternative | |
push_protection_bypassed_at | JSON | Optional | |
push_protection_bypassed_at (anyOf 1) | string | Alternative | The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. Format: date-time |
push_protection_bypassed_at (anyOf 2) | null | Alternative | |
push_protection_bypassed_by | Model | Optional | Expand Get an issue — response body — user |
resolution | Model | Optional | Expand Get a secret scanning alert — response body — resolution |
resolution_comment | JSON | Optional | |
resolution_comment (anyOf 1) | string | Alternative | An optional comment to resolve an alert. |
resolution_comment (anyOf 2) | null | Alternative | |
resolved_at | JSON | Optional | |
resolved_at (anyOf 1) | string | Alternative | The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. Format: date-time |
resolved_at (anyOf 2) | null | Alternative | |
resolved_by | Model | Optional | Expand Get an issue — response body — user |
secret | string | Optional | The secret that was detected. |
secret_type | string | Optional | The type of secret that secret scanning detected. |
secret_type_display_name | string | Optional | User-friendly name for the detected secret, matching the `secret_type`. For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." |
state | string | Optional | Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. Known values: open, resolved |
updated_at | Model | Optional | Expand Get a secret scanning alert — response body — updated at |
url | string | Optional | The REST API URL of the alert resource. Format: uri Read only: true |
validity | string | Optional | The token status as of the latest validity check. Known values: active, inactive, unknown |
Referenced models: Get a Dependabot alert — response body — number, Get a secret scanning alert — response body — updated at, Get a secret scanning alert — response body — first location detected, Get an issue — response body — user, Get a secret scanning alert — response body — resolution
List secret scanning alerts for a repository — request body — query
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
state | string | Optional | One of: open, resolved |
secret_type | string | Optional | |
exclude_secret_types | string | Optional | |
exclude_providers | string | Optional | |
providers | string | Optional | |
resolution | string | Optional | |
assignee | string | Optional | |
sort | string | Optional | Default: created One of: created, updated |
direction | string | Optional | Default: desc One of: asc, desc |
page | integer | Optional | Default: 1 |
per_page | integer | Optional | Default: 30 |
before | string | Optional | |
after | string | Optional | |
validity | string | Optional | |
is_publicly_leaked | boolean | Optional | Default: false |
is_multi_repo | boolean | Optional | Default: false |
hide_secret | boolean | Optional | Default: false |
is_bypassed | boolean | Optional | |
included_metadata | string | Optional | |
owner_email_hash | string | Optional |
Get a Dependabot alert — response body — number
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | integer | Alternative | The security alert number. Read only: true |
$ (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Get a secret scanning alert — response body — updated at
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | string | Alternative | The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. Format: date-time Read only: true |
$ (anyOf 2) | null | Alternative |
Get an issue — response body — user
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | Model | Alternative | Expand Get an issue — response body — user A Git Hub user |
$ (anyOf 2) | null | Alternative |
Referenced models: Get an issue — response body — user A Git Hub user
Get a secret scanning alert — response body — resolution
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | string | Alternative | **Required when the `state` is `resolved`.** The reason for resolving the alert. Known values: false_positive, wont_fix, revoked, used_in_tests |
$ (anyOf 2) | null | Alternative |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: github.secret_scanning_list_alerts_for_repo. Catalog operation: secret-scanning/list-alerts-for-repo. 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.
Refused by default. This operation leaves the caller holding a credential (Returns discovered secrets, including credentials for third-party providers.), so Alter refuses it on every connection with credential_minting_refused unless an organization admin allows it: a credential_minting rule naming provider github and operation github.secret_scanning_list_alerts_for_repo (or secret-scanning/list-alerts-for-repo). See Allow an operation that hands over a credential.
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"}