Skip to content

Add secret scanning REST API functions (alerts and locations) [Changelog 2021-12-01] #619

@MariusStorhaug

Description

Summary

Secret scanning has no coverage in this module — there is no SecretScanning command category under src/functions/public/. The secret scanning REST API lets you list and update alerts and enumerate the locations where a detected secret appears, which is key for remediation automation.

Changelog reference

Desired capability

Add functions for the secret scanning REST API:

  • Get-GitHubSecretScanningAlert — list/get alerts for a repo, org, or enterprise, with filters (state, secret type, resolution).
  • Set-GitHubSecretScanningAlert — update alert state (open/resolved) with resolution reason/comment.
  • Get-GitHubSecretScanningAlertLocation — list the locations (commits/paths) where a secret was detected.

Acceptance criteria

  • Functions use Invoke-GitHubAPI and the active GitHubContext; pagination handled.
  • Typed alert/location objects with default formats.
  • Org- and enterprise-level listing supported in addition to repo-level.
  • Integration tests against an owned repo with secret scanning enabled (skipped gracefully when unavailable).

Notes

  • Requires secret_scanning_alerts read/write (or repo) scope; enterprise endpoints require enterprise admin access.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions