File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
.github/actions/container-size-diff Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 4040 DELTA=$(( ${TO_SIZE} - ${FROM_SIZE} ))
4141
4242 if [[ ${FROM_SIZE} -eq 0 ]]; then
43- # If base size was 0, and there's a change, that's infinite percentage change
43+ # If from size was 0, and there's a change, that's infinite percentage change
4444 if [[ ${TO_SIZE} -gt 0 ]]; then
4545 PERCENT_CHANGE=" +∞"
4646 else
4747 PERCENT_CHANGE=" +0.00"
4848 fi
4949 else
50- PERCENT_CHANGE=$( awk -v head =" ${TO_SIZE} " -v base =" ${FROM_SIZE} " ' BEGIN { printf "%+0.2f", ((head - base ) / base ) * 100 }' )
50+ PERCENT_CHANGE=$( awk -v to =" ${TO_SIZE} " -v from =" ${FROM_SIZE} " ' BEGIN { printf "%+0.2f", ((to - from ) / from ) * 100 }' )
5151 fi
5252
5353 if (( DELTA < 0 )) ; then
5454 ICON=" 🔽"
55- MD_COLOR_START=" <span style=\" color:green\" >"
56- MD_COLOR_END=" </span>"
5755 elif (( DELTA > 0 )) ; then
5856 ICON=" 🔼"
59- MD_COLOR_START=" <span style=\" color:red\" >"
60- MD_COLOR_END=" </span>"
6157 else
6258 ICON=" 🔄"
63- MD_COLOR_START=" "
64- MD_COLOR_END=" "
6559 fi
6660
67- echo " | ${PLATFORM} | $( numfmt --to iec --format ' %.2f' ${FROM_SIZE} ) | $( numfmt --to iec --format ' %.2f' ${TO_SIZE} ) | ${MD_COLOR_START} $ ( numfmt --to iec --format ' %.2f' ${DELTA} ) (${PERCENT_CHANGE} %)${MD_COLOR_END} | ${ICON} |"
61+ echo " | ${PLATFORM} | $( numfmt --to iec --format ' %.2f' ${FROM_SIZE} ) | $( numfmt --to iec --format ' %.2f' ${TO_SIZE} ) | $( numfmt --to iec --format ' %.2f' ${DELTA} ) (${PERCENT_CHANGE} %) | ${ICON} |"
6862done
You can’t perform that action at this time.
0 commit comments