Skip to content

Commit faa59e0

Browse files
committed
Set Github format
1 parent 3f7e3d5 commit faa59e0

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

.github/workflows/action_publish-images-security-updates.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,6 @@ jobs:
3535
ignore-unfixed: true
3636
severity: 'CRITICAL,HIGH'
3737
hide-progress: true
38-
39-
- name: Upload trivy report as a Github artifact
40-
uses: actions/upload-artifact@v4
41-
with:
42-
name: trivy-sbom-report
43-
path: '${{ github.workspace }}/trivy-results.json'
44-
retention-days: 20
4538

4639
# Parse results to set has_vulnerabilities (for workflow control)
4740
- if: inputs.skip_scan != true
@@ -52,12 +45,23 @@ jobs:
5245
VULN_COUNT=$(jq -r '.vulnerabilities | length // 0' trivy-results.json)
5346
if [ "${VULN_COUNT:-0}" -gt 0 ]; then
5447
echo "has_vulnerabilities=true" >> "$GITHUB_OUTPUT"
48+
49+
# Create native GitHub annotations for vulnerabilities
50+
echo "# Security Vulnerabilities Found" >> $GITHUB_STEP_SUMMARY
51+
echo "| Severity | Package | Installed Version | Vulnerability ID | Description |" >> $GITHUB_STEP_SUMMARY
52+
echo "|----------|---------|-------------------|------------------|-------------|" >> $GITHUB_STEP_SUMMARY
53+
54+
jq -r '.vulnerabilities[] | "| \(.severity) | \(.pkgName) | \(.installedVersion) | \(.vulnerabilityID) | \(.title) |"' trivy-results.json >> $GITHUB_STEP_SUMMARY
55+
56+
echo "::notice::Found ${VULN_COUNT} security vulnerabilities that need to be addressed."
5557
else
5658
echo "has_vulnerabilities=false" >> "$GITHUB_OUTPUT"
59+
echo "No vulnerabilities found." >> $GITHUB_STEP_SUMMARY
5760
fi
5861
else
5962
echo "Error: trivy-results.json not found"
6063
echo "has_vulnerabilities=false" >> "$GITHUB_OUTPUT"
64+
echo "::error::trivy-results.json not found"
6165
exit 1
6266
fi
6367

0 commit comments

Comments
 (0)