Skip to content

Commit e189e7c

Browse files
Copilotfelickz
andauthored
Fix get_secret_scanning_scan_history to use direct API call
The method was using query_once which defaults to cursor-based pagination. The scan-history endpoint returns a single JSON object (not a paginated list), so pagination params were incorrect and HTTP errors were silently swallowed. Now uses _get directly so: - No spurious per_page/before query params - HTTP errors (e.g. 403) properly propagate to callers Agent-Logs-Url: https://github.com/advanced-security/ghas-api-python-scripts/sessions/7fb48030-50b4-4f88-bce8-1e571af0e38b Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
1 parent 20515fa commit e189e7c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

githubapi.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,11 @@ def get_secret_scanning_scan_history(self, repo_nwo: str) -> dict:
545545
"""Get secret scanning scan history for a single repository.
546546
547547
Returns the raw JSON response from GET /repos/{owner}/{repo}/secret-scanning/scan-history.
548+
Raises on HTTP errors so callers can handle them.
548549
"""
549-
result = self.query_once("repo", repo_nwo, "/secret-scanning/scan-history")
550-
return result if result is not None else {}
550+
url = self.construct_api_url("repo", repo_nwo, "/secret-scanning/scan-history", None, None)
551+
response = self._get(url)
552+
return response.json()
551553

552554

553555
def parse_date(date: str) -> datetime.datetime | None:

0 commit comments

Comments
 (0)