Update CI workflows and OSV scan script for improved functionality
- Updated the 'checkout' action to version 4 for consistency across workflows. - Added a 'Setup Go' step to initialize the Go environment using the latest action version. - Modified the OSV scan script to generalize vulnerability reporting, removing specific severity checks for a broader output.
This commit is contained in:
@@ -23,20 +23,16 @@ VULNS=$(jq -r '
|
||||
.results[]? |
|
||||
.source as $src |
|
||||
.vulns[]? |
|
||||
select(
|
||||
(.database_specific.severity // "" | ascii_upcase | test("HIGH|CRITICAL")) or
|
||||
(.severity[]?.score // "" | tostring | split("/")[0] | tonumber? // 0 | . >= 7.0)
|
||||
) |
|
||||
"\(.id) (source: \($src))"
|
||||
' "$OSV_JSON")
|
||||
|
||||
if [ -n "$VULNS" ]; then
|
||||
echo "OSV scan found HIGH/CRITICAL vulnerabilities:"
|
||||
echo "OSV scan found vulnerabilities:"
|
||||
echo "$VULNS" | while IFS= read -r line; do
|
||||
echo " - $line"
|
||||
done
|
||||
exit 1
|
||||
else
|
||||
echo "OSV scan: no HIGH/CRITICAL vulnerabilities found."
|
||||
echo "OSV scan: no vulnerabilities found."
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user