From 2f2d9c8d973458b13b6061edad26ef886b09efa0 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 28 Oct 2026 18:58:03 +0100 Subject: [PATCH] tools: fix number comparison if Nix diff viewer Signed-off-by: Antoine du Hamel PR-URL: https://github.com/nodejs/node/pull/66904 Reviewed-By: Filip Skokan --- .github/workflows/nix-changes-comment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nix-changes-comment.yml b/.github/workflows/nix-changes-comment.yml index 1eccc6a710d..371ed669d1f 100644 --- a/.github/workflows/nix-changes-comment.yml +++ b/.github/workflows/nix-changes-comment.yml @@ -54,7 +54,7 @@ jobs: AFTER=$(wc -l < "requisites-${PLATFORM}-after.list") TOTAL_AFTER=$(($TOTAL_AFTER + $AFTER)) DIFF="_no changes_" - [ "$BEFORE" = "$AFTER" ] || DIFF="**$([ "$AFTER" < "$BEFORE" ] || echo '+')$(($AFTER - $BEFORE))**" + [ "$BEFORE" = "$AFTER" ] || DIFF="**$([ "$AFTER" -lt "$BEFORE" ] || echo '+')$(($AFTER - $BEFORE))**" CHANGED=$(git diff --no-index "requisites-${PLATFORM}-before.list" "requisites-${PLATFORM}-after.list" | grep -c '^+[^+]') TOTAL_CHANGED=$(($TOTAL_CHANGED + $CHANGED)) PERCENT=100 @@ -68,7 +68,7 @@ jobs: done DIFF="_no changes_" - [ "$TOTAL_BEFORE" = "$TOTAL_AFTER" ] || DIFF="**$([ "$TOTAL_AFTER" < "$TOTAL_BEFORE" ] || echo '+')$(($TOTAL_AFTER - $TOTAL_BEFORE))**" + [ "$TOTAL_BEFORE" = "$TOTAL_AFTER" ] || DIFF="**$([ "$TOTAL_AFTER" -lt "$TOTAL_BEFORE" ] || echo '+')$(($TOTAL_AFTER - $TOTAL_BEFORE))**" PERCENT=100 [ "$TOTAL_CHANGED" = "$TOTAL_AFTER" ] || { PERMILLE=$((1000 * $TOTAL_CHANGED / $TOTAL_AFTER))