Skip to content

Commit b1d18ce

Browse files
committed
feat(github-actions): install pnpm in actions environment when pnpm is set at the package manager (#2647)
Based on the package manager value of the root package.json file, conditionally install pnpm PR Close #2647
1 parent c9a5692 commit b1d18ce

File tree

1 file changed

+9
-0
lines changed
  • github-actions/npm/checkout-and-setup-node

1 file changed

+9
-0
lines changed

github-actions/npm/checkout-and-setup-node/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ runs:
5151
node-version-file: ${{ inputs.node-version-file-path }}
5252
node-version: ${{ inputs.node-version }}
5353

54+
- id: packageManager
55+
shell: bash
56+
run: |
57+
echo "PACKAGE_MANAGER=$(cat package.json | jq ".packageManager" | sed -E 's/.*(npm|pnpm|yarn).*/\1/g')" > "$GITHUB_OUTPUT"
58+
59+
- if: steps.packageManager.outputs.PACKAGE_MANAGER == 'pnpm'
60+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
61+
62+
5463
# TODO(josephperrott): Determine if its safe to use this caching step.
5564
# - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
5665
# if: ${{ inputs.cache-node-modules == 'true' }}

0 commit comments

Comments
 (0)