From bce3c1457ec347ff11cc86a929149b4d90e84389 Mon Sep 17 00:00:00 2001 From: Lex Christopherson Date: Sat, 14 Mar 2026 16:56:57 -0600 Subject: [PATCH] fix(ci): strip ANSI codes and match version line in smoke test The --version flag outputs a banner with ANSI escape codes. The smoke test compared the entire multi-line output against the bare version string, causing false failures on every release. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/build-native.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-native.yml b/.github/workflows/build-native.yml index 2cd18711a..8fa8e849e 100644 --- a/.github/workflows/build-native.yml +++ b/.github/workflows/build-native.yml @@ -220,13 +220,16 @@ jobs: if npm install "gsd-pi@${VERSION}" 2>&1 | tee /tmp/install-output.txt; then echo " ✓ Install succeeded" # Run version check via node directly (npx may resolve wrong binary) - ACTUAL=$(node node_modules/gsd-pi/dist/loader.js --version 2>&1 || echo "FAILED") + # Strip ANSI escape codes and match version on any line (--version prints a banner) + RAW=$(node node_modules/gsd-pi/dist/loader.js --version 2>&1 || echo "FAILED") + ACTUAL=$(echo "$RAW" | sed 's/\x1b\[[0-9;]*m//g' | grep -oE "^${VERSION}$" | head -1) if [ "$ACTUAL" = "$VERSION" ]; then echo " ✓ gsd --version = ${VERSION}" echo "Published package is functional" exit 0 else - echo "::error::Version mismatch: expected ${VERSION}, got ${ACTUAL}" + echo "::error::Version mismatch: expected ${VERSION} in output:" + echo "$RAW" exit 1 fi fi