Skip to content

Commit

Permalink
fix(ci): reverted to standard JSON results for now, as table was fail…
Browse files Browse the repository at this point in the history
…ing and back to the drawing board
  • Loading branch information
bilals12 committed Dec 11, 2024
1 parent 47414bb commit 09b55cc
Showing 1 changed file with 6 additions and 30 deletions.
36 changes: 6 additions & 30 deletions container-scan/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,36 +90,12 @@ runs:

- name: Format Results for PR
run: |
echo "## Lacework Vulnerabilities Report" > pr-results.md
echo "| Severity | Count | Fixable | Exceptions |" >> pr-results.md
echo "|------------|-------|---------|------------|" >> pr-results.md
jq -r '.cve | [
"Critical", .critical_vulnerabilities, .fixable_critical_vulnerabilities, .critical_exception_vulnerabilities,
"High", .high_vulnerabilities, .fixable_high_vulnerabilities, .high_exception_vulnerabilities,
"Medium", .medium_vulnerabilities, .fixable_medium_vulnerabilities, .medium_exception_vulnerabilities,
"Low", .low_vulnerabilities, .fixable_low_vulnerabilities, .low_exception_vulnerabilities,
"Info", .info_vulnerabilities, .fixable_info_vulnerabilities, .info_exception_vulnerabilities
] | @csv' results.stdout | awk -F',' '
{
if (NR % 4 == 1) printf "| %-10s | %-5s | %-7s | %-10s |\n", $1, $2, $3, $4
}' >> pr-results.md
echo "\n### Vulnerability Details" >> pr-results.md
echo "| Package | CVE ID | Severity | Current Version | Fix Version |" >> pr-results.md
echo "|-------------------|----------------|----------|-----------------|---------------|" >> pr-results.md
jq -r '.vulnerabilities[] | [
.package, .vulnerability_id, .severity, .current_version, .fix_version
] | @csv' results.stdout | awk -F',' '
{
printf "| %-17s | %-14s | %-8s | %-15s | %-13s |\n", $1, $2, $3, $4, $5
}' >> pr-results.md
echo "## Lacework Inline Scanner Results" > pr-results.md
echo "<details><summary>Click to expand</summary>" >> pr-results.md
echo "<pre>" >> pr-results.md
cat results.stdout >> pr-results.md
echo "</pre>" >> pr-results.md
echo "</details>" >> pr-results.md
shell: bash

- name: Check for Previous Report Comment
Expand Down

0 comments on commit 09b55cc

Please sign in to comment.