From 3de3236c984a2d7a437ab13a1537660e0845ddf8 Mon Sep 17 00:00:00 2001 From: Konstantin Renner Date: Fri, 26 Jun 2026 23:21:37 +0200 Subject: [PATCH] ci: fix migrate-tfstate resource guard (grep -c counts lines on compact JSON) The pulled state is compact (one line), so grep -c returned 1. Count occurrences instead. Co-Authored-By: Claude Opus 4.8 (1M context) --- .woodpecker/migrate-tfstate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.woodpecker/migrate-tfstate.yml b/.woodpecker/migrate-tfstate.yml index d6903059..1c240214 100644 --- a/.woodpecker/migrate-tfstate.yml +++ b/.woodpecker/migrate-tfstate.yml @@ -46,8 +46,8 @@ steps: BYTES=$(wc -c < /tmp/state.json) echo "pulled state bytes $BYTES" test "$BYTES" -gt 2000 - RES=$(grep -c '"type"' /tmp/state.json || true) - echo "resource entries $RES" + RES=$(grep -o '"mode"' /tmp/state.json | wc -l) + echo "resource occurrences $RES" test "$RES" -gt 10 echo "### 2/4 repoint the backend block to Hetzner (checkout only)" -- 2.54.0