Skip to content

fix: move lock files to test-fixtures, pnpm global-bin-dir, node-based version detection - #12

Merged
mayurrawte merged 1 commit into
masterfrom
fix/pnpm-path-version-detection
May 21, 2026
Merged

mayurrawte merged 1 commit into
masterfrom
fix/pnpm-path-version-detection

Conversation

@mayurrawte

Copy link
Copy Markdown
Owner

Fixes all remaining test failures. Three root causes:

1. pnpm-lock.yaml in repo root broke npm/yarn/node-matrix jobs
Angular CLI 19 auto-detects lock files to choose the package manager. Having pnpm-lock.yaml in root caused every npm/yarn test job to fail with: The project is configured to use 'pnpm', but it is not installed or cannot be found.

Fix: moved pnpm-lock.yaml and yarn.lock to .github/test-fixtures/ (Angular CLI only detects root-level lock files). Test workflow now passes cache-dependency-path: .github/test-fixtures/pnpm-lock.yaml for pnpm jobs.

2. pnpm global bin not on PATH
pnpm v9+ puts global bins in {PNPM_HOME}/bin/, but pnpm/action-setup only adds PNPM_HOME itself to PATH. Error: The configured global bin directory is not in PATH.

Fix: pnpm config set global-bin-dir "$PNPM_HOME" before the global install — bins go directly into PNPM_HOME which is already on PATH.

3. Version detection via ng version was unreliable
ng version inside the composite action had PATH timing issues (GITHUB_PATH updates don't take effect within the same composite action) and pipefail edge cases.

Fix: replaced with node -e "require(...package.json).version" — reads the installed @angular/cli/package.json directly via npm root -g / pnpm root -g / yarn global dir. No PATH dependency, works cross-platform.

@mayurrawte
mayurrawte merged commit b9c24bb into master May 21, 2026
20 of 26 checks passed
@mayurrawte
mayurrawte deleted the fix/pnpm-path-version-detection branch May 21, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant