GeekMasher/ghastoolkit

CodeScanning.getAlerts() returns wrong data type

Closed this issue · 3 comments

Currently CodeScanning.getAlerts() (octokit/codescanning.py on line 94) returns a list[dict] instead of the expected list[CodeAlert]. This causes any usage that expects CodeAlert objects to fail. For example, when Policy as Code attempts to access CodeAlert properties in checks.py starting on line 89, an exception is raised since a 'dict' object does not have those properties.

It looks like this may have been introduced with the changes to CodeScanning.getAlerts() in commit 88195cc.

Example of the error when this happens:
image

@Pradoxzon you are absolutely right, let me create a PR for this now.

Thank you for the prompt fix!