Skip to content

Commit 20515fa

Browse files
Copilotfelickz
andauthored
Address review feedback: guard against zero-length groups
Agent-Logs-Url: https://github.com/advanced-security/ghas-api-python-scripts/sessions/f6a777a1-48ca-4999-ba66-76934aa82818 Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
1 parent a5a59af commit 20515fa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

get_secret_scanning_scan_history_progress.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,11 @@ def print_progress_summary(
226226

227227
group = groups[(cat, scan_type)]
228228
total = len(group)
229+
if total == 0:
230+
continue
229231
completed_count = sum(1 for r in group if r.status == "completed")
230232
in_progress_count = sum(1 for r in group if r.status == "in_progress")
231-
pct = min(round((completed_count / total) * 100), 100) if total > 0 else 0
233+
pct = round((completed_count / total) * 100)
232234
missing_count = max(success_repos - total, 0)
233235

234236
# Most recent completed timestamp

0 commit comments

Comments
 (0)