From 4177fdeac76cdd7f5219b4a48682de0322ac8930 Mon Sep 17 00:00:00 2001 From: Abishek V Ashok Date: Tue, 28 Mar 2023 16:42:09 +0530 Subject: [PATCH] Github actions fix: Have some output for errors SARIF expects some information about tooling when there are no issues, SAPP currently doesn't print any information and exits silently in case there are no issues after applying filters. Github Actions expects the output to conform to SARIF. Hence, return empty results list along with tooling information as expected by SARIF. Signed-off-by: Abishek V Ashok --- sapp/ui/filters.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sapp/ui/filters.py b/sapp/ui/filters.py index 738355c0..5e6840f9 100644 --- a/sapp/ui/filters.py +++ b/sapp/ui/filters.py @@ -250,11 +250,7 @@ def filter_run( total_filtered_issues_output = ( f"Total number of issues after filtering: {len(query_results)}" ) - if len(query_results) <= 0: - LOG.error(total_filtered_issues_output) - return - else: - LOG.info(total_filtered_issues_output) + LOG.info(total_filtered_issues_output) if output_format == "sapp": output_json = {"issues": [issue.to_json() for issue in query_results]} print(json.dumps(output_json, indent=2, default=str))