pnpm / action-setup

Install pnpm package manager
https://github.com/marketplace/actions/setup-pnpm
MIT License
899 stars 87 forks source link

pnpm unable to detect package.json when running action inside a reusable workflow #52

Closed josefaidt closed 2 years ago

josefaidt commented 2 years ago

Hey folks, I decided to move my release steps into dedicated jobs in order to deploy to separate environments, and as such noticed pnpm is no longer able to detect my package.json since the cwd is the current repo

[release](https://github.com/josefaidt/fakerepo/runs/7584874320?check_suite_focus=true#step:2:17)
Error: ENOENT: no such file or directory, open '/home/runner/work/fakerepo/fakerepo/package.json'

is there a way to detect the repo name in order to prevent duplicating it in the detected path? or can we manually re-point the package.json path?

for example, here is a snippet from the release flow where we're calling a reusable release-env action

release:
    runs-on: ubuntu-latest
    needs: setup
    if: needs.setup.outputs.is-prerelease == false
    environment: main
    steps:
      - uses: ./.github/workflows/release-env.yml
        with:
          env: main
          version: ${{ needs.setup.outputs.tag }}
          is-prerelease: ${{ needs.setup.outputs.is-prerelease }}