1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

Merge pull request #5369 from sylvestre/size

Binary sizes: handle when 0 (relpath removal)
This commit is contained in:
Daniel Hofstetter 2023-10-07 07:40:24 +02:00 committed by GitHub
commit 91c8724fd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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