diff --git a/pontos/github/api/code_scanning.py b/pontos/github/api/code_scanning.py index 78e11ba09..da994f01c 100644 --- a/pontos/github/api/code_scanning.py +++ b/pontos/github/api/code_scanning.py @@ -45,6 +45,8 @@ async def _alerts( params["direction"] = enum_or_value(direction) async for response in self._client.get_all(api, params=params): + response.raise_for_status() + for alert in response.json(): yield CodeScanningAlert.from_dict(alert) diff --git a/pontos/github/api/dependabot.py b/pontos/github/api/dependabot.py index 44db73cd0..1a5e3084d 100644 --- a/pontos/github/api/dependabot.py +++ b/pontos/github/api/dependabot.py @@ -50,6 +50,8 @@ async def _alerts( params["direction"] = enum_or_value(direction) async for response in self._client.get_all(api, params=params): + response.raise_for_status() + for alert in response.json(): yield DependabotAlert.from_dict(alert) diff --git a/pontos/github/api/secret_scanning.py b/pontos/github/api/secret_scanning.py index 4186c14df..4065d5a5b 100644 --- a/pontos/github/api/secret_scanning.py +++ b/pontos/github/api/secret_scanning.py @@ -48,6 +48,8 @@ async def _alerts( params["direction"] = enum_or_value(direction) async for response in self._client.get_all(api, params=params): + response.raise_for_status() + for alert in response.json(): yield SecretScanningAlert.from_dict(alert) @@ -353,6 +355,8 @@ async def locations( params = {"per_page": "100"} async for response in self._client.get_all(api, params=params): + response.raise_for_status() + for location in response.json(): location_type = location["type"] location_details = location["details"]