Skip to content

Commit 7fcb45c

Browse files
committed
fix(build): correct trivy fallback condition to rely on sbom scan
1 parent e7325f7 commit 7fcb45c

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

.unirtm.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,10 @@ if [ "${CI:-}" = "true" ] || [ "${GITHUB_ACTIONS:-}" = "true" ]; then
142142
unirtm exec -- trivy fs --format cyclonedx --output sbom.json .
143143
unirtm exec -- trivy sbom sbom.json
144144
else
145+
unirtm exec -- trivy fs --format cyclonedx --output sbom.json .
145146
# Try offline mode first. If missing DB, it will fail and we fallback to online.
146-
if unirtm exec -- trivy fs --skip-db-update --skip-java-db-update --skip-check-update --offline-scan --format cyclonedx --output sbom.json . >/dev/null 2>&1; then
147-
unirtm exec -- trivy sbom --skip-db-update --skip-java-db-update --offline-scan sbom.json
148-
else
147+
if ! unirtm exec -- trivy sbom --skip-db-update --skip-java-db-update --offline-scan sbom.json; then
149148
echo "⚠️ Local Trivy DB missing. Downloading from AWS ECR fallback..."
150-
unirtm exec -- trivy fs --format cyclonedx --output sbom.json .
151149
unirtm exec -- trivy sbom sbom.json
152150
fi
153151
fi

0 commit comments

Comments
 (0)