Get secret scanning scan history for a repository
Lists the latest default incremental and backfill scans by type for a repository.
[!NOTE] This endpoint requires GitHub Advanced Security.
OAuth app tokens and personal access tokens (classic) need the repo or security_events scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo scope instead.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The account owner of the repository. The name is not case sensitive.
The name of the repository without the .git extension. The name is not case sensitive.
Responses
Section titled “ Responses ”Response
object
Information on a single scan performed by secret scanning on the repository
object
The type of scan
The state of the scan. Either “completed”, “running”, “pending”, “failed”, or “unknown”.
“failed”: this scan type has hit its retry limit and has been marked permanently failed. This usually resolves on its own at the next scheduled scan attempt. If “failed” persists, contact Support.
“unknown”: the scan is in an unrecognized or currently unhandled state.
The time that the scan was completed. Empty if the scan is running
The time that the scan was started. Empty if the scan is pending
Information on a single scan performed by secret scanning on the repository
object
The type of scan
The state of the scan. Either “completed”, “running”, “pending”, “failed”, or “unknown”.
“failed”: this scan type has hit its retry limit and has been marked permanently failed. This usually resolves on its own at the next scheduled scan attempt. If “failed” persists, contact Support.
“unknown”: the scan is in an unrecognized or currently unhandled state.
The time that the scan was completed. Empty if the scan is running
The time that the scan was started. Empty if the scan is pending
Information on a single scan performed by secret scanning on the repository
object
The type of scan
The state of the scan. Either “completed”, “running”, “pending”, “failed”, or “unknown”.
“failed”: this scan type has hit its retry limit and has been marked permanently failed. This usually resolves on its own at the next scheduled scan attempt. If “failed” persists, contact Support.
“unknown”: the scan is in an unrecognized or currently unhandled state.
The time that the scan was completed. Empty if the scan is running
The time that the scan was started. Empty if the scan is pending
object
The type of scan
The state of the scan. Either “completed”, “running”, “pending”, “failed”, or “unknown”.
“failed”: this scan type has hit its retry limit and has been marked permanently failed. This usually resolves on its own at the next scheduled scan attempt. If “failed” persists, contact Support.
“unknown”: the scan is in an unrecognized or currently unhandled state.
The time that the scan was completed. Empty if the scan is running
The time that the scan was started. Empty if the scan is pending
Name of the custom pattern for custom pattern scans
Level at which the custom pattern is defined, one of “repository”, “organization”, or “enterprise”
Information on a single scan performed by secret scanning on the repository
object
The type of scan
The state of the scan. Either “completed”, “running”, “pending”, “failed”, or “unknown”.
“failed”: this scan type has hit its retry limit and has been marked permanently failed. This usually resolves on its own at the next scheduled scan attempt. If “failed” persists, contact Support.
“unknown”: the scan is in an unrecognized or currently unhandled state.
The time that the scan was completed. Empty if the scan is running
The time that the scan was started. Empty if the scan is pending
Examples
{ "incremental_scans": [ { "type": "git", "status": "completed", "completed_at": "2024-10-07T02:47:00Z" } ], "backfill_scans": [ { "type": "git", "status": "completed", "started_at": "2024-10-07T02:47:00Z", "completed_at": "2024-10-07T02:50:00Z" }, { "type": "issue", "status": "completed", "started_at": "2024-10-07T02:47:00Z", "completed_at": "2024-10-07T02:49:00Z" }, { "type": "discussion", "status": "completed", "started_at": "2024-10-07T02:47:00Z", "completed_at": "2024-10-07T02:48:00Z" } ], "pattern_update_scans": [ { "type": "discussion", "status": "in_progress", "started_at": "2024-10-07T02:47:00Z", "completed_at": "2024-10-07T02:51:00Z" } ], "custom_pattern_backfill_scans": [ { "type": "git", "status": "completed", "started_at": "2024-10-07T02:47:00Z", "completed_at": "2024-10-07T02:55:00Z", "pattern_slug": "my-custom-pattern", "pattern_scope": "enterprise" }, { "type": "git", "status": "completed", "started_at": "2024-10-07T02:47:00Z", "completed_at": "2024-10-07T02:55:00Z", "pattern_slug": "my-custom-pattern", "pattern_scope": "organization" } ], "generic_secrets_backfill_scans": [ { "type": "git", "status": "completed", "started_at": "2024-10-07T02:47:00Z", "completed_at": "2024-10-07T02:55:00Z" } ]}Repository does not have GitHub Advanced Security or secret scanning enabled
Service unavailable
object
Example generated
{ "code": "example", "message": "example", "documentation_url": "example"}