pnpm / pnpm/action-setup

action-setup@v6 does not install pnpm version specified in `package_json_file`

Open
#227 6 comments 35 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

This is probably the same underlying cause as #225

When specifying package_json_file and that package.json file has a packageManager field that specifies the version of pnpm to use, the v6 release does not load the specified version.

This results in the following error, which we are currently seeing across tens of repos:

ERR_PNPM_BROKEN_LOCKFILE  The lockfile at "<path>/pnpm-lock.yaml" is broken: expected a single document in the stream, but found more

The packageManager field is set to pnpm 10 in the specified package.json file:

$ grep packageManager package.json
  "packageManager": "pnpm@10.28.1",

The GitHub Action is invoked with the package_json_file input argument only:

    - name: Setup pnpm
      uses: pnpm/action-setup@v6
      with:
        package_json_file: "${{ inputs.working-directory }}/package.json"

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

Start by reproducing the GitHub Actions invocation with package_json_file pointing to a package.json whose packageManager is pnpm@10.28.1, then inspect how action-setup@v6 resolves that field. Done means the specified pnpm version is installed and the reported broken-lockfile error no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd, devops, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.