Skip to content

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.

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 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.secret_scanning.secret_scanning_list_alerts_for_repo(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.ownerstringRequired within parent
path.repostringRequired within parent
queryModelOptionalExpand List secret scanning alerts for a repository — request body — query

Referenced models: List secret scanning alerts for a repository — request body — query

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

FieldTypePresenceDescription and constraints
$arrayRoot
$[]ModelEach itemExpand List secret scanning alerts for a repository — response body — item

Referenced models: List secret scanning alerts for a repository — response body — item

15 more schemas are linked from the tables above, on the schema pages.

List secret scanning alerts for a repository — response body — item
FieldTypePresenceDescription and constraints
$objectRoot
assigned_toModelOptionalExpand Get an issue — response body — user
closure_request_commentJSONOptional
closure_request_comment (anyOf 1)stringAlternativeAn optional comment from the closure request author.
closure_request_comment (anyOf 2)nullAlternative
closure_request_reviewerModelOptionalExpand Get an issue — response body — user
closure_request_reviewer_commentJSONOptional
closure_request_reviewer_comment (anyOf 1)stringAlternativeAn optional comment from the closure request reviewer.
closure_request_reviewer_comment (anyOf 2)nullAlternative
created_atstringOptionalThe time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
Format: date-time
Read only: true
first_location_detectedModelOptionalExpand Get a secret scanning alert — response body — first location detected
has_more_locationsbooleanOptionalA boolean value representing whether or not the token in the alert was detected in more than one location.
html_urlstringOptionalThe GitHub URL of the alert resource.
Format: uri
Read only: true
is_base64_encodedJSONOptional
is_base64_encoded (anyOf 1)booleanAlternativeA boolean value representing whether or not alert is base64 encoded
is_base64_encoded (anyOf 2)nullAlternative
locations_urlstringOptionalThe REST API URL of the code locations for this alert.
Format: uri
multi_repoJSONOptional
multi_repo (anyOf 1)booleanAlternativeWhether the detected secret was found in multiple repositories under the same organization or enterprise.
multi_repo (anyOf 2)nullAlternative
numberModelOptionalExpand Get a Dependabot alert — response body — number
providerJSONOptional
provider (anyOf 1)stringAlternativeThe provider of the secret that was detected.
provider (anyOf 2)nullAlternative
provider_slugJSONOptional
provider_slug (anyOf 1)stringAlternativeThe 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)nullAlternative
publicly_leakedJSONOptional
publicly_leaked (anyOf 1)booleanAlternativeWhether the detected secret was publicly leaked.
publicly_leaked (anyOf 2)nullAlternative
push_protection_bypass_request_commentJSONOptional
push_protection_bypass_request_comment (anyOf 1)stringAlternativeAn optional comment when requesting a push protection bypass.
push_protection_bypass_request_comment (anyOf 2)nullAlternative
push_protection_bypass_request_html_urlJSONOptional
push_protection_bypass_request_html_url (anyOf 1)stringAlternativeThe URL to a push protection bypass request.
Format: uri
push_protection_bypass_request_html_url (anyOf 2)nullAlternative
push_protection_bypass_request_reviewerModelOptionalExpand Get an issue — response body — user
push_protection_bypass_request_reviewer_commentJSONOptional
push_protection_bypass_request_reviewer_comment (anyOf 1)stringAlternativeAn optional comment when reviewing a push protection bypass.
push_protection_bypass_request_reviewer_comment (anyOf 2)nullAlternative
push_protection_bypassedJSONOptional
push_protection_bypassed (anyOf 1)booleanAlternativeWhether push protection was bypassed for the detected secret.
push_protection_bypassed (anyOf 2)nullAlternative
push_protection_bypassed_atJSONOptional
push_protection_bypassed_at (anyOf 1)stringAlternativeThe time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
Format: date-time
push_protection_bypassed_at (anyOf 2)nullAlternative
push_protection_bypassed_byModelOptionalExpand Get an issue — response body — user
resolutionModelOptionalExpand Get a secret scanning alert — response body — resolution
resolution_commentJSONOptional
resolution_comment (anyOf 1)stringAlternativeAn optional comment to resolve an alert.
resolution_comment (anyOf 2)nullAlternative
resolved_atJSONOptional
resolved_at (anyOf 1)stringAlternativeThe time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
Format: date-time
resolved_at (anyOf 2)nullAlternative
resolved_byModelOptionalExpand Get an issue — response body — user
secretstringOptionalThe secret that was detected.
secret_typestringOptionalThe type of secret that secret scanning detected.
secret_type_display_namestringOptionalUser-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)."
statestringOptionalSets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`.
Known values: open, resolved
updated_atModelOptionalExpand Get a secret scanning alert — response body — updated at
urlstringOptionalThe REST API URL of the alert resource.
Format: uri
Read only: true
validitystringOptionalThe 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
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
statestringOptionalOne of: open, resolved
secret_typestringOptional
exclude_secret_typesstringOptional
exclude_providersstringOptional
providersstringOptional
resolutionstringOptional
assigneestringOptional
sortstringOptionalDefault: created
One of: created, updated
directionstringOptionalDefault: desc
One of: asc, desc
pageintegerOptionalDefault: 1
per_pageintegerOptionalDefault: 30
beforestringOptional
afterstringOptional
validitystringOptional
is_publicly_leakedbooleanOptionalDefault: false
is_multi_repobooleanOptionalDefault: false
hide_secretbooleanOptionalDefault: false
is_bypassedbooleanOptional
included_metadatastringOptional
owner_email_hashstringOptional
Get a Dependabot alert — response body — number
FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)integerAlternativeThe security alert number.
Read only: true
$ (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
Get a secret scanning alert — response body — updated at
FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)stringAlternativeThe time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
Format: date-time
Read only: true
$ (anyOf 2)nullAlternative
Get an issue — response body — user
FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)ModelAlternativeExpand Get an issue — response body — user A Git Hub user
$ (anyOf 2)nullAlternative

Referenced models: Get an issue — response body — user A Git Hub user

Get a secret scanning alert — response body — resolution
FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)stringAlternative**Required when the `state` is `resolved`.** The reason for resolving the alert.
Known values: false_positive, wont_fix, revoked, used_in_tests
$ (anyOf 2)nullAlternative

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

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.