Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Use version of pnpm specified in package.json's engines section #84

Open
kopach opened this issue Jun 5, 2023 · 1 comment

Comments

@kopach
Copy link

kopach commented Jun 5, 2023

In my projects, I'm trying to specify exact versions of dependencies (including node and pnpm).

I would like to specify a version of pnpm once in package.json and reuse in pnpm/action-setup action

package.json has engines section for this

{
  "engines": {
    "pnpm": "7.32.5"
  },
}

Would be great, if pnpm/action-setup could support this field.

Note: actions/setup-node supports engines.node via node-version-file property.

I'm also aware of packageManager property of package.json, but with it – I can't enforce exact version of PNPM, however with engines.pnpm + engine-strict=true - I can, so everyone in the team has same environment


It might be related to this: #24

@kopach
Copy link
Author

kopach commented Jun 5, 2023

For anyone interested, as a workaround, I'm doing this right now

    - name: Get PNPM version from package.json
      id: pnpm-version
      shell: bash
      run: echo "pnpm_version=$(node -p 'require(`./package.json`).engines.pnpm')" >> $GITHUB_OUTPUT

    - name: Install PNPM
      uses: pnpm/action-setup@v2.2.4
      with:
        version: ${{ steps.pnpm-version.outputs.pnpm_version }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant