Skip to content

Commit 99aab85

Browse files
authored
ci(repo): tolerate pnpm warnings in turbo validate step (#8624)
1 parent e1773ef commit 99aab85

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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"

0 commit comments

Comments
 (0)