Skip to content

Commit 159ec84

Browse files
committed
feat(actions): use package-manager-cache input in checkout-and-setup-node
The `cache` input in `actions/setup-node` is deprecated and will be removed in a future version. This commit updates the `checkout-and-setup-node` action to use the new `package-manager-cache` input instead. The default value of `disable-package-manager-cache` has also been changed to `true` to reflect the new default behavior of `actions/setup-node`.
1 parent 43fc44a commit 159ec84

File tree

1 file changed

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

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ inputs:
1919
2020
disable-package-manager-cache:
2121
description: 'When set to true, disables the package manager cache.'
22-
default: false
22+
default: true
2323

2424
runs:
2525
using: composite
@@ -43,9 +43,6 @@ runs:
4343
run: |
4444
PM=$(jq -r '.packageManager | match("^(npm|pnpm|yarn)@").captures[0].string' package.json || echo "")
4545
echo "PACKAGE_MANAGER=$PM" >> "$GITHUB_OUTPUT"
46-
if [ "$PM" == "pnpm" ]; then
47-
echo "CACHE_MANAGER_VALUE=pnpm" >> "$GITHUB_OUTPUT"
48-
fi
4946
5047
- if: steps.packageManager.outputs.PACKAGE_MANAGER == 'pnpm'
5148
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
@@ -56,4 +53,4 @@ runs:
5653
with:
5754
node-version-file: ${{ inputs.node-version-file-path }}
5855
node-version: ${{ inputs.node-version }}
59-
cache: ${{ inputs.disable-package-manager-cache != 'true' && steps.packageManager.outputs.CACHE_MANAGER_VALUE || '' }}
56+
package-manager-cache: ${{ inputs.disable-package-manager-cache != 'true' }}

0 commit comments

Comments
 (0)