File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ---
Original file line number Diff line number Diff line change @@ -384,12 +384,16 @@ jobs:
384384 # from turbo.json, hiding real configuration errors.
385385 TASK_NAME="test:integration:${{ matrix.test-name }}"
386386 TURBO_STDERR=$(mktemp)
387- if ! TURBO_JSON =$(pnpm turbo run "$TASK_NAME" --dry=json 2>"$TURBO_STDERR"); then
387+ if ! TURBO_RAW =$(pnpm turbo run "$TASK_NAME" --dry=json 2>"$TURBO_STDERR"); then
388388 echo "::error::Turbo task '$TASK_NAME' failed validation"
389389 cat "$TURBO_STDERR"
390390 exit 1
391391 fi
392392
393+ # pnpm can prepend non-JSON lines (e.g. `WARN Unsupported engine: ...`)
394+ # to stdout, which would break jq. Drop everything before the first `{`.
395+ TURBO_JSON=$(printf '%s\n' "$TURBO_RAW" | awk '/^\{/{found=1} found')
396+
393397 if ! TASK_COUNT=$(jq -er '.tasks | length' <<< "$TURBO_JSON"); then
394398 echo "::error::Turbo task '$TASK_NAME' returned invalid JSON or missing .tasks"
395399 printf '%s\n' "$TURBO_JSON"
You can’t perform that action at this time.
0 commit comments