Fix scorecard warning summaries
This commit is contained in:
parent
0a166f3a5d
commit
b922f4ddf5
|
|
@ -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'
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue