From 07bc0098e36a039f3ffcbd6848044abcf1642d27 Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Sun, 26 Apr 2026 18:39:46 +0000 Subject: [PATCH] ci(woodpecker): show full terraform error on stack apply failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The default workflow truncated the failed-stack output at `tail -5`, which only captured the trailing source-line indicator (`│ 45: resource …`) and dropped the actual `Error: …` line above it. Bump to `tail -50` so the real error is visible without re-running locally to reproduce. Also fix the pre-warm step's FIRST_STACK detection — `head -1 file1 file2 | head -1` returns the file header (`==> .platform_apply <==`), not the first stack name, so the cd then fails with "no such file or directory". Use `cat | head -1` instead. Pure logging-and-pre-warm change; no stacks touched, so this commit is a no-op for the apply step. --- .woodpecker/default.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.woodpecker/default.yml b/.woodpecker/default.yml index 9e0d1fe5..fa6ffc4a 100644 --- a/.woodpecker/default.yml +++ b/.woodpecker/default.yml @@ -128,7 +128,7 @@ steps: # ── Pre-warm provider cache ── - | if [ -s .platform_apply ] || [ -s .app_apply ]; then - FIRST_STACK=$(head -1 .platform_apply .app_apply 2>/dev/null | head -1) + FIRST_STACK=$(cat .platform_apply .app_apply 2>/dev/null | head -1) if [ -n "$FIRST_STACK" ]; then echo "Pre-warming provider cache from stacks/$FIRST_STACK..." cd "stacks/$FIRST_STACK" && terragrunt init --terragrunt-non-interactive -input=false 2>&1 | tail -3 && cd ../.. @@ -150,7 +150,7 @@ steps: if echo "$OUTPUT" | grep -q "is locked by"; then echo "[$stack] SKIPPED (locked by another session)" else - echo "$OUTPUT" | tail -5 + echo "$OUTPUT" | tail -50 echo "[$stack] FAILED (exit $EXIT)" FAILED_PLATFORM_STACKS="$FAILED_PLATFORM_STACKS $stack" fi @@ -178,7 +178,7 @@ steps: if echo "$OUTPUT" | grep -q "is locked by"; then echo "[$stack] SKIPPED (locked by another session)" else - echo "$OUTPUT" | tail -5 + echo "$OUTPUT" | tail -50 echo "[$stack] FAILED (exit $EXIT)" FAILED_APP_STACKS="$FAILED_APP_STACKS $stack" fi