Skip to content

Commit 65478cf

Browse files
committed
fix(github-actions): replace package-manager-cache with cache option in checkout-and-setup-node (#3151)
In `actions/setup-node` version 6 `package-manager-cache` is only supported for npm. See: actions/setup-node#1374 PR Close #3151
1 parent 380d026 commit 65478cf

File tree

1 file changed

+5
-2
lines changed
  • github-actions/npm/checkout-and-setup-node

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,18 @@ runs:
4949
run: |
5050
PM=$(jq -r '.packageManager | match("^(npm|pnpm|yarn)@").captures[0].string' package.json || echo "")
5151
echo "PACKAGE_MANAGER=$PM" >> "$GITHUB_OUTPUT"
52+
if [ "$PM" == "pnpm" ]; then
53+
echo "CACHE_MANAGER_VALUE=pnpm" >> "$GITHUB_OUTPUT"
54+
fi
5255
5356
- if: steps.packageManager.outputs.PACKAGE_MANAGER == 'pnpm'
5457
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
5558
with:
5659
run_install: false
5760

58-
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
61+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
5962
with:
6063
node-version-file: ${{ inputs.node-version-file-path }}
6164
node-version: ${{ inputs.node-version }}
6265
cache-dependency-path: ${{ inputs.cache-dependency-path }}
63-
package-manager-cache: ${{ inputs.disable-package-manager-cache != 'true' }}
66+
cache: ${{ inputs.disable-package-manager-cache != 'true' && steps.packageManager.outputs.CACHE_MANAGER_VALUE || '' }}

0 commit comments

Comments
 (0)