From 9328cb6122241108fdec719c8a3e9d6d84f5359b Mon Sep 17 00:00:00 2001 From: mayurrawte Date: Thu, 21 May 2026 13:50:54 +0530 Subject: [PATCH 1/2] fix: use pnpm list -g --json for version detection instead of pnpm root -g --- action.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/action.yml b/action.yml index 7a28321..999333e 100644 --- a/action.yml +++ b/action.yml @@ -76,16 +76,20 @@ runs: env: INPUT_PM: ${{ inputs.package-manager }} run: | - # Read version directly from the installed package.json — no PATH dependency if [ "$INPUT_PM" = "pnpm" ]; then - CLI_ROOT=$(pnpm root -g 2>/dev/null || echo "") + # pnpm list -g --json is reliable regardless of store location + CLI_VERSION=$(pnpm list -g @angular/cli --json 2>/dev/null | node -e \ + "let b='';process.stdin.on('data',c=>b+=c);process.stdin.on('end',()=>{try{const a=JSON.parse(b);const i=Array.isArray(a)?a[0]:a;process.stdout.write(i?.dependencies?.['@angular/cli']?.version||'unknown')}catch(e){process.stdout.write('unknown')}})" \ + 2>/dev/null || echo "unknown") elif [ "$INPUT_PM" = "yarn" ]; then - CLI_ROOT="$(yarn global dir 2>/dev/null)/node_modules" + export CLI_ROOT="$(yarn global dir 2>/dev/null)/node_modules" + CLI_VERSION=$(node -e \ + "try{process.stdout.write(require(process.env.CLI_ROOT+'/@angular/cli/package.json').version)}catch(e){process.stdout.write('unknown')}" \ + 2>/dev/null || echo "unknown") else - CLI_ROOT=$(npm root -g 2>/dev/null || echo "") + export CLI_ROOT=$(npm root -g 2>/dev/null || echo "") + CLI_VERSION=$(node -e \ + "try{process.stdout.write(require(process.env.CLI_ROOT+'/@angular/cli/package.json').version)}catch(e){process.stdout.write('unknown')}" \ + 2>/dev/null || echo "unknown") fi - export CLI_ROOT - CLI_VERSION=$(node -e \ - "try{process.stdout.write(require(process.env.CLI_ROOT+'/@angular/cli/package.json').version)}catch(e){process.stdout.write('unknown')}" \ - 2>/dev/null || echo "unknown") echo "cli-version=${CLI_VERSION:-unknown}" >> "$GITHUB_OUTPUT" From 3158656f10f548787848dfbbbd5ce30041dccf4f Mon Sep 17 00:00:00 2001 From: mayurrawte Date: Thu, 21 May 2026 14:15:33 +0530 Subject: [PATCH 2/2] =?UTF-8?q?test:=20disable=20pnpm=20cache=20in=20test?= =?UTF-8?q?=20=E2=80=94=20setup-node=20store=20path=20unreliable=20on=20Wi?= =?UTF-8?q?ndows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d63cf82..b540529 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,8 +55,10 @@ jobs: version: 'latest' node-version: '22' package-manager: 'pnpm' - # Lock file is in test-fixtures to avoid Angular CLI auto-detecting pnpm in npm/yarn jobs - cache-dependency-path: '.github/test-fixtures/pnpm-lock.yaml' + # Disable cache: setup-node pnpm store caching is unreliable on Windows + # when using pnpm/action-setup@v4 (non-standard PNPM_HOME path). + # Core functionality (ng on PATH, version detection) is still tested. + cache: 'false' - name: Verify CLI version output is set shell: bash