Skip to content

Commit ba608ba

Browse files
committed
chore: remove color from container size diff
1 parent bb0ead0 commit ba608ba

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

.github/actions/container-size-diff/container-size-diff.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,29 +40,23 @@ do
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} |"
6862
done

0 commit comments

Comments
 (0)