From 13bf0639c69bbfd49a12628beab58bfd3924808c Mon Sep 17 00:00:00 2001 From: Hugh Hackman Date: Sun, 22 Mar 2026 05:59:48 +0000 Subject: [PATCH] fix(ci): use python3 for pnpm detection instead of node node is not on PATH before the Setup Node step runs on ARC runners (minimal Docker-based containers). The node -e command exits 127, is silently swallowed by 2>/dev/null, and the || echo 'false' fallback sets has_package_manager=false. This causes the Corepack branch to be skipped and pnpm/action-setup@v4 to run with version:latest, which conflicts with packageManager in package.json. python3 is pre-installed on Ubuntu ARC runners (no setup required) and reliably parses JSON via the stdlib json module. Fixes pnpm version conflict on headlamp-polaris-plugin PR #103. Co-Authored-By: Paperclip --- .github/workflows/plugin-ci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/plugin-ci.yaml b/.github/workflows/plugin-ci.yaml index 07013b4..eceeb44 100644 --- a/.github/workflows/plugin-ci.yaml +++ b/.github/workflows/plugin-ci.yaml @@ -26,7 +26,9 @@ jobs: # Check for packageManager field in package.json (Corepack pinning). # pnpm/action-setup@v4 errors when `packageManager` is set (even without # a `version` input), so we use Corepack directly for those repos. - PM=$(node -e "try{const p=require('./package.json');const v=p.packageManager||'';console.log(v.startsWith('pnpm@')?'true':'false')}catch(e){console.log('false')}" 2>/dev/null || echo "false") + # Use python3 (pre-installed on Ubuntu ARC runners) instead of node, + # because node is not on PATH before the Setup Node step runs. + PM=$(python3 -c "import json,sys; d=json.load(open('package.json')); print('true' if d.get('packageManager','').startswith('pnpm@') else 'false')" 2>/dev/null || echo "false") echo "has_package_manager=$PM" >> $GITHUB_OUTPUT else echo "manager=npm" >> $GITHUB_OUTPUT