Skip to content

Project residing in a subdirectory: caching fails #21

Description

@urban-adeininger

I have a project in a subdirectory website, inside this directory, there exists package.json, pnpm-lock-yaml and pnpm-workspace.yaml. I want to use pnpm inside this directory via a GitHub action. This is the relevant part of my GitHub workflow file:

jobs:
  build:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: ./website
    steps:
      - name: Checkout your repository using git
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

      - name: Set up pnpm
        uses: pnpm/setup@c9883cc79df532ad1a7b81bf9ab944ceb090d65c # v2.0.0
        with:
          runtime: node@26
          version: 11
          cache: true

While running this workflow action, I'm getting an error:

Run pnpm/setup@c9883cc79df532ad1a7b81bf9ab944ceb090d65c
  with:
    runtime: node@26
    version: 11
    cache: true
    dest: ~/setup-pnpm
    cache-dependency-path: pnpm-lock.yaml
    package-json-file: package.json
    install: true
    token: ***
  
Installing pnpm...
  Downloading pnpm 11.20.0 from https://github.com/pnpm/pnpm/releases/download/v11.20.0/pnpm-linux-x64.tar.gz
Installation Completed!
Installing runtime node@26...
  Progress: resolved 1, reused 0, downloaded 0, added 0
  Packages: +1
  +
  Progress: resolved 1, reused 0, downloaded 1, added 0
  Packages are hard linked from the content-addressable store to the virtual store.
    Content-addressable store is at: /home/runner/setup-pnpm/store/v11
    Virtual store is at:             store/v11/links
  Progress: resolved 1, reused 0, downloaded 1, added 1, done
  global:
  + node 26.7.0
  Done in 1.6s using pnpm v11.20.0
Restoring cache...
  /home/runner/setup-pnpm/pnpm store path
  /home/runner/setup-pnpm/store/v11
  Error: Some specified paths were not resolved, unable to cache dependencies.
      at lhe (/home/runner/work/_actions/pnpm/setup/c9883cc79df532ad1a7b81bf9ab944ceb090d65c/dist/index.js:314:31904)
  Error: Error: Some specified paths were not resolved, unable to cache dependencies.
      at async kEt (/home/runner/work/_actions/pnpm/setup/c9883cc79df532ad1a7b81bf9ab944ceb090d65c/dist/index.js:314:32738)
      at async K0t (/home/runner/work/_actions/pnpm/setup/c9883cc79df532ad1a7b81bf9ab944ceb090d65c/dist/index.js:328:3785)
      at async W0t (/home/runner/work/_actions/pnpm/setup/c9883cc79df532ad1a7b81bf9ab944ceb090d65c/dist/index.js:328:3521)

After setting cache: false, the action succeeds.

Caching should work even if a working-directory is defined for the action.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions