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.
This commit is contained in:
Gustavo Valverde
2026-04-10 21:10:10 +01:00
parent ca5d303607
commit 2e0ad30369

View File

@@ -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."