@@ -13,10 +13,10 @@ inputs:
1313 description : Expected Node.js version already installed by actions/setup-node.
1414 required : false
1515 default : " "
16- use-actions- cache :
17- description : Whether actions/cache should restore the pnpm store .
16+ cache-mode :
17+ description : Cache authority for this setup action (off, restore, or read-write) .
1818 required : false
19- default : " true "
19+ default : " off "
2020outputs :
2121 pnpm-version :
2222 description : Resolved pnpm version activated by the setup action.
@@ -40,10 +40,18 @@ runs:
4040 id : setup-pnpm
4141 shell : bash
4242 env :
43+ CACHE_MODE : ${{ inputs.cache-mode }}
4344 PACKAGE_MANAGER_FILE : ${{ inputs.package-manager-file }}
4445 REQUESTED_NODE_VERSION : ${{ inputs.node-version }}
4546 run : |
4647 set -euo pipefail
48+ case "$CACHE_MODE" in
49+ off|restore|read-write) ;;
50+ *)
51+ echo "::error::Invalid cache-mode input: '$CACHE_MODE' (expected off, restore, or read-write)"
52+ exit 2
53+ ;;
54+ esac
4755 project_dir="$(dirname "$PACKAGE_MANAGER_FILE")"
4856 if [[ ! -f "$PACKAGE_MANAGER_FILE" ]]; then
4957 echo "::error::package manager file not found: $PACKAGE_MANAGER_FILE"
8896
8997 - name : Resolve pnpm store path
9098 id : pnpm-store
91- if : ${{ inputs.use-actions- cache == 'true ' && runner.os != 'Windows' }}
99+ if : ${{ inputs.cache-mode != 'off ' && runner.os != 'Windows' }}
92100 shell : bash
93101 run : |
94102 set -euo pipefail
98106
99107 - name : Restore pnpm store cache
100108 id : pnpm-store-cache
101- if : ${{ inputs.use-actions- cache == 'true ' && runner.os != 'Windows' }}
109+ if : ${{ inputs.cache-mode != 'off ' && runner.os != 'Windows' }}
102110 uses : actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
103111 with :
104112 path : ${{ steps.pnpm-store.outputs.path }}
0 commit comments