1
0
mirror of https://github.com/uutils/coreutils synced 2024-07-09 12:16:25 +00:00

Binary sizes: handle when 0 (relpath removal)

This commit is contained in:
Sylvestre Ledru 2023-10-06 22:08:04 +02:00
parent a596cda516
commit 98cfb0c322

View File

@ -610,6 +610,12 @@ jobs:
check() {
# Warn if the size increases by more than 5%
threshold='1.05'
if [[ "$2" -eq 0 || "$3" -eq 0 ]]; then
echo "::warning file=$4::Invalid size for $1. Sizes cannot be 0."
return
fi
ratio=$(jq -n "$2 / $3")
echo "$1: size=$2, previous_size=$3, ratio=$ratio, threshold=$threshold"
if [[ "$(jq -n "$ratio > $threshold")" == 'true' ]]; then