From bbccff8196f30b68134c71ed7c257dc3589cfd99 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 28 Oct 2025 16:54:33 +0800 Subject: [PATCH] Fix `MATCH_COUNT` grep bug (#614) --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 72a0de1..003e9db 100644 --- a/action.yml +++ b/action.yml @@ -236,7 +236,7 @@ runs: COMMIT_MSG="Auto-format by https://ultralytics.com/actions" # Check if last two commits were both auto-format to prevent recursive loops LAST_TWO=$(git log -2 --pretty=format:'%s' 2>/dev/null || echo "") - MATCH_COUNT=$(printf '%s\n' "$LAST_TWO" | grep -Fxc "$COMMIT_MSG" || echo "0") + MATCH_COUNT=$(printf '%s\n' "$LAST_TWO" | grep -Fxc "$COMMIT_MSG" || true) if [ "$MATCH_COUNT" -ge 2 ]; then echo "Skipping commit: last two commits were auto-format" exit 0