Skip to content

Commit c65eed6

Browse files
committed
Update GitHub Actions workflow to improve output formatting for vulnerability checks. Changed output values for has_vulnerabilities to use quotes for consistency. Enhanced conditional logic to allow builds to proceed if forced, regardless of vulnerability status.
1 parent 2edcacb commit c65eed6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
VULN_COUNT=$(jq -r '[.Results[] | (.Vulnerabilities, .Secrets) | select(. != null) | length] | add // 0' trivy-results.json)
5454
5555
if [ "${VULN_COUNT:-0}" -gt 0 ]; then
56-
echo "has_vulnerabilities=true" >> "$GITHUB_OUTPUT"
56+
echo "has_vulnerabilities='true'" >> "$GITHUB_OUTPUT"
5757
5858
echo "# Security Findings Found" >> $GITHUB_STEP_SUMMARY
5959
@@ -75,12 +75,11 @@ jobs:
7575
7676
echo "::notice::Found ${VULN_COUNT} security findings that need to be addressed."
7777
else
78-
echo "has_vulnerabilities=false" >> "$GITHUB_OUTPUT"
78+
echo "has_vulnerabilities='false'" >> "$GITHUB_OUTPUT"
7979
echo "No security findings found." >> $GITHUB_STEP_SUMMARY
8080
fi
8181
else
82-
echo "Error: trivy-results.json not found"
83-
echo "has_vulnerabilities=false" >> "$GITHUB_OUTPUT"
82+
echo "has_vulnerabilities='false'" >> "$GITHUB_OUTPUT"
8483
echo "::error::trivy-results.json not found"
8584
exit 1
8685
fi
@@ -98,7 +97,7 @@ jobs:
9897
9998
build-security-updates:
10099
needs: [scan-vulnerabilities, get-latest-release]
101-
if: needs.scan-vulnerabilities.outputs.has_vulnerabilities == 'true'
100+
if: needs.scan-vulnerabilities.outputs.has_vulnerabilities == 'true' || inputs.force_build == true
102101
uses: ./.github/workflows/service_docker-build-and-publish.yml
103102
secrets: inherit
104103
with:

0 commit comments

Comments
 (0)