From 56bd00f35c0e85710ee18958f1f85cbf73daf4d8 Mon Sep 17 00:00:00 2001 From: Sagar Khalasi Date: Tue, 12 Nov 2024 18:23:45 +0530 Subject: [PATCH] Minor change for log --- .github/workflows/test-vulnerabilities-data.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-vulnerabilities-data.yml b/.github/workflows/test-vulnerabilities-data.yml index d071bd1568c9..f0ad5395cf23 100644 --- a/.github/workflows/test-vulnerabilities-data.yml +++ b/.github/workflows/test-vulnerabilities-data.yml @@ -65,16 +65,20 @@ jobs: - name: Check for new vulnerabilities in Scout and Trivy files if: always() run: | - # Check if Scout vulnerabilities file is not empty - if [ -s "scout_new_vulnerabilities.csv" ]; then + # Check if Scout vulnerabilities file has data after the header + if [ $(tail -n +2 scout_new_vulnerabilities.csv | wc -l) -gt 0 ]; then echo "Scout vulnerabilities detected." cat scout_new_vulnerabilities.csv exit 1 # Fail the job if data exists + else + echo "No new Scout vulnerabilities detected." fi - - # Check if Trivy vulnerabilities file is not empty - if [ -s "trivy_new_vulnerabilities.csv" ]; then + + # Check if Trivy vulnerabilities file has data after the header + if [ $(tail -n +2 trivy_new_vulnerabilities.csv | wc -l) -gt 0 ]; then echo "Trivy vulnerabilities detected." cat trivy_new_vulnerabilities.csv exit 1 # Fail the job if data exists + else + echo "No new Trivy vulnerabilities detected." fi \ No newline at end of file