Skip to content

Commit

Permalink
fix(ci/cve-scanning): delete empty files (#1130)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwrau committed Aug 23, 2024
1 parent 104b16c commit 78d20dd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/scripts/generate-sarif-reports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ function generateSarifReport() {
awk '{print $NF}' |
jq -r -c -Rn '[inputs] | map({fullyQualifiedName: .})')"
trivy image "$image" -f sarif --quiet --ignore-unfixed | jq -r --argjson locations "$locationsJson" '.runs |= map(.results |= map(.locations |= ([$locations[], .[]])))' >"$outFile"
# delete empty files, otherwise the check if they should be uploaded doesn't work correctly
[[ -s "$outFile" ]] || rm -f "$outFile"
}
export -f generateSarifReport

Expand Down

0 comments on commit 78d20dd

Please sign in to comment.