Skip to content

Commit 47fb7b8

Browse files
committed
Add more field to secret results
1 parent 855b09f commit 47fb7b8

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

list_secret_scanning_alerts.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def make_result(
2828
else None
2929
),
3030
"push_protection_bypassed_at": alert["push_protection_bypassed_at"],
31-
"repo": alert["repository"]["full_name"] if scope != "repo" else name,
31+
"repo": alert["repository"]["full_name"] if scope != "repo" and "repository" in alert else name,
3232
"url": alert["html_url"],
3333
"state": alert["state"],
3434
"resolution": alert["resolution"],
@@ -39,6 +39,19 @@ def make_result(
3939
"resolution_comment": alert["resolution_comment"],
4040
"validity": alert["validity"],
4141
"secret_type": alert["secret_type"],
42+
"multi_repo": alert.get("multi_repo"),
43+
"publicly_leaked": alert.get("publicly_leaked"),
44+
"push_protection_bypass_request_reviewer": (
45+
alert["push_protection_bypass_request_reviewer"]["login"]
46+
if alert["push_protection_bypass_request_reviewer"] is not None
47+
else None
48+
),
49+
"push_protection_bypass_request_reviewer_comment": alert.get(
50+
"push_protection_bypass_request_reviewer_comment"
51+
),
52+
"push_protection_bypass_request_comment": alert.get(
53+
"push_protection_bypass_request_comment"
54+
)
4255
}
4356

4457
if include_secret:

0 commit comments

Comments
 (0)