Fix scorecard warning summaries

This commit is contained in:
juvdiaz 2026-06-29 20:18:02 -06:00
parent 0a166f3a5d
commit b922f4ddf5
1 changed files with 8 additions and 2 deletions

View File

@ -10,6 +10,7 @@ score() {
local severity="$2"
shift 2
local output
local summary
local status
printf '%-28s ' "$label"
@ -28,9 +29,14 @@ score() {
warnings=$((warnings + 1))
printf 'warn'
fi
if [ -n "$output" ]; then
printf ' - %s' "$(printf '%s' "$output" | grep -v '^+' | head -n 1)"
summary="$(
printf '%s\n' "$output" |
awk 'NF && $0 !~ /^\+/ { print; exit }'
)"
if [ -z "$summary" ]; then
summary="check exited with status ${status}"
fi
printf ' - %s' "$summary"
printf '\n'
}