Skip to content

Commit

Permalink
feat: add ::warning output if running in Github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
portswigger-tim committed Sep 7, 2023
1 parent e53ffe1 commit c66bce4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion wrapper/outputters/console.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

SUCCESS = "✅"
FAIL = "❌"

Expand Down Expand Up @@ -75,9 +77,11 @@ def output_issue_counts(target_issues: list) -> None:
case _:
issue_counts["unknown"] += 1

total_issues = sum(issue_counts.values())

issue_count_message = f"""Issue Count Summary:
Total issues : {sum(issue_counts.values())}
Total issues : {total_issues}
Critical : {issue_counts["critical"]}
High : {issue_counts["high"]}
Expand All @@ -86,3 +90,7 @@ def output_issue_counts(target_issues: list) -> None:
Info : {issue_counts["info"]}
Unknown : {issue_counts["unknown"]}"""
print(issue_count_message)

if total_issues > 0 and os.environ.get("GITHUB_ACTIONS", False):
print("")
print(f"::warning ::{total_issues} issues detected")

0 comments on commit c66bce4

Please sign in to comment.