@@ -17,18 +17,6 @@ inputs:
1717 Relative path to the nvm version file to set node version, exclusive with
1818 node-version-file-path input. Defaults to .nvmrc
1919
20- cache-node-modules :
21- default : false
22- type : boolean
23- description : |
24- Whether to cache the node_modules directory, this is helpful when postinstalls are performed
25- and modify the resulting node_modules directory. Defaults to False.
26-
27- node-module-directories :
28- default : ./node_modules
29- description : |
30- Space delimited list of node_modules directories to cache. Defaults to `./node_modules`
31-
3220runs :
3321 using : composite
3422 steps :
@@ -46,23 +34,25 @@ runs:
4634 persist-credentials : false
4735 ref : ${{ inputs.ref }}
4836
49- - uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
50- with :
51- node-version-file : ${{ inputs.node-version-file-path }}
52- node-version : ${{ inputs.node-version }}
53-
5437 - id : packageManager
5538 shell : bash
5639 run : |
5740 echo "PACKAGE_MANAGER=$(cat package.json | jq ".packageManager" | sed -E 's/"(npm|pnpm|yarn)@.*/\1/g')" > "$GITHUB_OUTPUT"
5841
5942 - if : steps.packageManager.outputs.PACKAGE_MANAGER == 'pnpm'
6043 uses : pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
44+ with :
45+ run_install : false
6146
47+ - if : steps.packageManager.outputs.PACKAGE_MANAGER == 'pnpm'
48+ - uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
49+ with :
50+ node-version-file : ${{ inputs.node-version-file-path }}
51+ node-version : ${{ inputs.node-version }}
52+ cache : ' pnpm'
6253
63- # TODO(josephperrott): Determine if its safe to use this caching step.
64- # - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
65- # if: ${{ inputs.cache-node-modules == 'true' }}
66- # with:
67- # path: ${{ inputs.node-module-directories }}
68- # key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock', '**/*.patch') }}
54+ - if : steps.packageManager.outputs.PACKAGE_MANAGER != 'pnpm'
55+ - uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
56+ with :
57+ node-version-file : ${{ inputs.node-version-file-path }}
58+ node-version : ${{ inputs.node-version }}
0 commit comments