From 54e420f032e370ac5d16f46dd081e78ad8e704b6 Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Fri, 27 Mar 2026 19:33:54 +0100 Subject: [PATCH] test: validate pnpm --version output in CI All version checks now capture output and assert it matches a semver pattern. Previously, a silently failing pnpm (exit 0, no output) would pass the tests. --- .github/workflows/test.yaml | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3bcbf44..575604a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -33,7 +33,14 @@ jobs: run: which pnpm; which pnpx - name: 'Test: version' - run: pnpm --version + run: | + actual="$(pnpm --version)" + echo "pnpm version: ${actual}" + if [[ ! "${actual}" =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then + echo "ERROR: pnpm --version did not produce valid output" + exit 1 + fi + shell: bash - name: 'Test: install in a fresh project' run: | @@ -71,7 +78,14 @@ jobs: run: which pnpm && which pnpx - name: 'Test: version' - run: pnpm --version + run: | + actual="$(pnpm --version)" + echo "pnpm version: ${actual}" + if [[ ! "${actual}" =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then + echo "ERROR: pnpm --version did not produce valid output" + exit 1 + fi + shell: bash test_standalone: name: Test with standalone @@ -98,7 +112,14 @@ jobs: run: which pnpm - name: 'Test: version' - run: pnpm --version + run: | + actual="$(pnpm --version)" + echo "pnpm version: ${actual}" + if [[ ! "${actual}" =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then + echo "ERROR: pnpm --version did not produce valid output" + exit 1 + fi + shell: bash - name: 'Test: install in a fresh project' run: | @@ -196,4 +217,11 @@ jobs: run: which pnpm; which pnpx - name: 'Test: version' - run: pnpm --version + run: | + actual="$(pnpm --version)" + echo "pnpm version: ${actual}" + if [[ ! "${actual}" =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then + echo "ERROR: pnpm --version did not produce valid output" + exit 1 + fi + shell: bash