action-setup icon indicating copy to clipboard operation
action-setup copied to clipboard

cahing question when used with actions/setup-node@v4

Open capaj opened this issue 1 year ago • 1 comments

in the readme you show this setup:

      - name: Get pnpm store directory
        shell: bash
        run: |
          echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

      - uses: actions/cache@v4
        name: Setup pnpm cache
        with:
          path: ${{ env.STORE_PATH }}
          key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
          restore-keys: |
            ${{ runner.os }}-pnpm-store-

wouldn't it be enough to use

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version-file: '.nvmrc'
          cache: 'pnpm'

?

capaj avatar Nov 29 '24 10:11 capaj

yes, see the example here: https://github.com/pnpm/action-setup/issues/80#issuecomment-2511621782

trim21 avatar Dec 02 '24 14:12 trim21