Get a secret scanning alert

Gets a single secret scanning alert detected in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the repo scope or security_events scope.

GitHub Apps must have the secret_scanning_alerts read permission to use this endpoint.

octokit.secretScanning.getAlert({
owner,
repo,
alert_number,
});

Parameters

namerequireddescription
owneryes
repoyes
alert_numberyes

The security alert number, found at the end of the security alert's URL.

See also: GitHub Developer Guide documentation.

List secret scanning alerts for a repository

Lists all secret scanning alerts for a private repository, from newest to oldest. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the repo scope or security_events scope.

GitHub Apps must have the secret_scanning_alerts read permission to use this endpoint.

octokit.secretScanning.listAlertsForRepo({
owner,
repo,
});

Parameters

namerequireddescription
owneryes
repoyes
stateno

Set to open or resolved to only list secret scanning alerts in a specific state.

pageno

Page number of the results to fetch.

per_pageno

Results per page (max 100)

See also: GitHub Developer Guide documentation.

Update a secret scanning alert

Updates the status of a secret scanning alert in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the repo scope or security_events scope.

GitHub Apps must have the secret_scanning_alerts write permission to use this endpoint.

octokit.secretScanning.updateAlert({
owner,
repo,
alert_number,
state,
});

Parameters

namerequireddescription
owneryes
repoyes
alert_numberyes

The security alert number, found at the end of the security alert's URL.

stateyes

Sets the state of the secret scanning alert. Can be either open or resolved. You must provide resolution when you set the state to resolved.

resolutionno

Required when the state is resolved. The reason for resolving the alert. Can be one of false_positive, wont_fix, revoked, or used_in_tests.

See also: GitHub Developer Guide documentation.