From 2e0ad3036966c962dae96de13b48f01eda070d41 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Fri, 10 Apr 2026 21:10:10 +0100 Subject: [PATCH] fix(ci): fix grep -c fallback producing invalid integer in release validation grep -coP outputs "0" to stdout on no matches but exits 1, causing the || echo 0 fallback to append a second "0". The resulting "0\n0" value fails the -lt integer comparison. Use || true instead since grep -c already outputs the correct count. --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c6f5c27bbe..64ebf2f7b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -177,8 +177,8 @@ jobs: fi # Count PR links in both files - RAW_COUNT=$(grep -coP '\[#\d+\]' "$RAW_PATH" || echo 0) - FINAL_COUNT=$(grep -coP '\[#\d+\]' "$FINAL" || echo 0) + RAW_COUNT=$(grep -coP '\[#\d+\]' "$RAW_PATH" || true) + FINAL_COUNT=$(grep -coP '\[#\d+\]' "$FINAL" || true) if [ "$FINAL_COUNT" -lt "$RAW_COUNT" ]; then echo "::warning::AI output has fewer PR links ($FINAL_COUNT) than raw ($RAW_COUNT). Falling back to raw notes."