pnpm / pnpm/action-setup

NPM package in subdirectory of repo does not work

Open
#155 1 comment 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.3k
Forks
217
Avg merge
8h 42m
Merged PRs (30d)
1

Description

Here is a repo where the NPM package is in a subdir (in this case apex): https://github.com/eighty4/eighty4.tech

When trying pnpm/action-setup I've run through variations of the config without any way of getting past the action failing looking for the pnpm lockfile at the repository root. Here are variations I've tried.

As a user I would expect just setting package_json_file path would work:

      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v4
        with:
          package_json_file: apex/package.json

I tried changing the cwd of run_install:

      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v4
        with:
          package_json_file: apex/package.json
          run_install: |
            - cwd: apex
              args: []

Even with run_install: false it still fails on the missing repository root pnpm lock file:

      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v4
        with:
          package_json_file: apex/package.json
          run_install: false

Am I overlooking a configuration for this project structure to work with pnpm/action-setup?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names the package_json_file and run_install inputs but no repository files or tests. Start by reproducing the failure with the linked eighty4.tech repository and inspect how pnpm/action-setup resolves the package and lockfile paths. Done means a package in a subdirectory can be set up without requiring a root pnpm lockfile.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, node.js, typescript
Domain
ci-cd, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.