pnpm / action-setup Goto Github PK
View Code? Open in Web Editor NEWInstall pnpm package manager
Home Page: https://github.com/marketplace/actions/setup-pnpm
License: MIT License
Install pnpm package manager
Home Page: https://github.com/marketplace/actions/setup-pnpm
License: MIT License
Hi, I'm trying to use this GitHub Action in a project that looks like this:
myproject
|-- .github/workflows/client-ci.yml
|-- backend
|-- client
I want to use pnpm
inside myproject/client/package.json
folder but this action:
- name: Setup pnpm
uses: pnpm/[email protected]
It's giving this error:
Running self-installer...
[Error: ENOENT: no such file or directory, open '/home/runner/work/myproject/myproject/package.json'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/home/runner/work/myproject/myproject/package.json'
}
I also tried setting destination. But I get the same error.
- name: Setup pnpm
uses: pnpm/[email protected]
with:
dest: ~+/client
I would appreciate any help. Thanks!
Hi,
The sample in the readme works for most platforms but not windows:
https://github.com/mtb-tools/vscode-mono-workspace/actions/runs/3269716040
This part is the culprit:
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
Run pnpm/action-setup@v[2](https://github.com/Satont/tsuwari/runs/6951188005?check_suite_focus=true#step:4:2).2.2
with:
version: 7
run_install: false
dest: ~/setup-pnpm
Running self-installer...
Error: ENOENT: no such file or directory, uv_cwd
at process.wrappedCwd (internal/bootstrap/switches/does_own_process_state.js:128:26)
at process.cwd (/mnt/volume/gh-runners/2/_work/_actions/pnpm/action-setup/v2.2.2/dist/pnpm.js:[3](https://github.com/Satont/tsuwari/runs/6951188005?check_suite_focus=true#step:4:3)2:23)
at ../../node_modules/.pnpm/[email protected].[4](https://github.com/Satont/tsuwari/runs/6951188005?check_suite_focus=true#step:4:4)2/node_modules/get-source/impl/path.js (/mnt/volume/gh-runners/2/_work/_actions/pnpm/action-setup/v2.2.2/dist/pnpm.js:29678:[5](https://github.com/Satont/tsuwari/runs/6951188005?check_suite_focus=true#step:4:5)8)
at __require (/mnt/volume/gh-runners/2/_work/_actions/pnpm/action-setup/v2.2.2/dist/pnpm.js:9:44)
at ../../node_modules/.pnpm/[email protected]/node_modules/get-source/get-source.js (/mnt/volume/gh-runners/2/_work/_actions/pnpm/action-setup/v2.2.2/dist/pnpm.js:297[6](https://github.com/Satont/tsuwari/runs/6951188005?check_suite_focus=true#step:4:7)6:16)
at __require (/mnt/volume/gh-runners/2/_work/_actions/pnpm/action-setup/v2.2.2/dist/pnpm.js:9:44)
at ../../node_modules/.pnpm/[email protected][7](https://github.com/Satont/tsuwari/runs/6951188005?check_suite_focus=true#step:4:8)/node_modules/stacktracey/stacktracey.js (/mnt/volume/gh-runners/2/_work/_actions/pnpm/action-setup/v2.2.2/dist/pnpm.js:30022:21)
at __require (/mnt/volume/gh-runners/2/_work/_actions/pnpm/action-setup/v2.2.2/dist/pnpm.js:[9](https://github.com/Satont/tsuwari/runs/6951188005?check_suite_focus=true#step:4:10):44)
at ../default-reporter/lib/reportError.js (/mnt/volume/gh-runners/2/_work/_actions/pnpm/action-setup/v2.2.2/dist/pnpm.js:302[21](https://github.com/Satont/tsuwari/runs/6951188005?check_suite_focus=true#step:4:22):41)
at __require (/mnt/volume/gh-runners/2/_work/_actions/pnpm/action-setup/v2.2.2/dist/pnpm.js:9:44) {
errno: -2,
code: 'ENOENT',
syscall: 'uv_cwd'
}
Error: Something went wrong, self-installer exits with code 1
Installation Completed!
With
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
On selfhosted ARM64 runner.
Also, the problem is not permanent. That is, sometimes it does not appear.
Error message when running pnpm/[email protected]
The
add-path
command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
When downloading the Node.js version specified in .npmrc#use-node-version
, cache the Node.js like actions/setup-node
so it can be setup faster next time
I would like to migrate from using a .nvmrc
file to specify the development Node.js version, to using pnpm's use-node-version
.
Currently on GitHub actions, I can configure actions/setup-node
to read from .nvmrc
, and it will download & cache the Node.js version so it only takes about 3s to setup.
However, when I move to using pnpm with this action, it doesn't seem to cache the downloaded Node.js and it adds about 8s to the pnpm setup:
Running pnpm recursive install...
Lockfile is up to date, resolution step is skipped
Progress: resolved 1, reused 0, downloaded 0, added 0
. | +386 ++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
Content-addressable store is at: /home/runner/.local/share/pnpm/store/v3
Virtual store is at: node_modules/.pnpm
Progress: resolved 386, reused 0, downloaded 49, added 45
Progress: resolved 386, reused 0, downloaded 147, added 144
Progress: resolved 386, reused 0, downloaded [24](https://github.com/privatenumber/resolve-pkg-maps/actions/runs/3667467601/jobs/6199946930#step:4:26)7, added 243
Progress: resolved 386, reused 0, downloaded 379, added 378
Progress: resolved 386, reused 0, downloaded 386, added 386, done
.../[email protected]/node_modules/esbuild postinstall$ node install.js
.../[email protected]/node_modules/esbuild postinstall: Done
Done in 6.7s
Running pnpm recursive install...
Fetching Node.js 16.15.1 ...
Packages are hard linked from the content-addressable store to the virtual store.
Content-addressable store is at: /home/runner/.local/share/pnpm/store/v3
Virtual store is at: node_modules/.pnpm
Lockfile is up to date, resolution step is skipped
Progress: resolved 1, reused 0, downloaded 0, added 0
. | +386 ++++++++++++++++++++++++++++++++
Progress: resolved 386, reused 0, downloaded 28, added [23](https://github.com/privatenumber/resolve-pkg-maps/actions/runs/3667468515/jobs/6199947937#step:3:25)
Progress: resolved 386, reused 0, downloaded 86, added 80
Progress: resolved 386, reused 0, downloaded 159, added 151
Progress: resolved 386, reused 0, downloaded 229, added 222
Progress: resolved 386, reused 0, downloaded [27](https://github.com/privatenumber/resolve-pkg-maps/actions/runs/3667468515/jobs/6199947937#step:3:29)9, added 273
Progress: resolved 386, reused 0, downloaded [34](https://github.com/privatenumber/resolve-pkg-maps/actions/runs/3667468515/jobs/6199947937#step:3:36)6, added 344
Progress: resolved 386, reused 0, downloaded 384, added 384
Progress: resolved 386, reused 0, downloaded 386, added 386, done
.../[email protected]/node_modules/esbuild postinstall$ node install.js
.../[email protected]/node_modules/esbuild postinstall: Done
Done in 14.5s
Hi, we see occasional failed pipelines because, well, something goes wrong in pnpm/action-setup
:
Running self-installer...
[stdin]:1
<HTML>
^
SyntaxError: Unexpected token '<'
at new Script (vm.js:84:7)
at createScript (vm.js:258:10)
at Object.runInThisContext (vm.js:306:10)
at Object.<anonymous> ([stdin]-wrapper:9:26)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at evalScript (internal/process/execution.js:80:25)
at internal/main/eval_stdin.js:29:5
at Socket.<anonymous> (internal/process/execution.js:192:5)
at Socket.emit (events.js:215:7)
at endReadableNT (_stream_readable.js:1184:12)
Error: Something does wrong, self-installer exits with code 1
Installation Completed!
Running pnpm recursive install --frozen-lockfile
Error: Command pnpm recursive install --frozen-lockfile (cwd: undefined) exits with status 127
I'm not sure if it's this line const response = await fetch('https://pnpm.js.org/pnpm.js')
that might fail? If it somehow gets an HTML response? So if pnpm.js.org fails to return the pnpm.js
script for a splitsecond, instead returning an HTML error page, then that could happen?
Will maintainers consider a retry mechanism to increase resilience? If the request is the cause of this error then an exponential backoff could work well, to try a couple times before giving up. WDYT?
Warning: The add-path
command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
My Action Step is
`
uses: pnpm/[email protected]
with:
version: 6.x
run_install: true
`
I am getting below error when running this action
Error in CI: ERR_PNPM_FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE Cannot perform a frozen installation because the lockfile needs updates
and when try to fix my lockfile locally with command npm i --fix-lockfile
i get following error:
`
npm i --fix-lockfile
npm ERR! Cannot read properties of null (reading 'matches')
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/un/.npm/_logs/2022-05-01T10_32_11_056Z-debug-0.log
`
The github action to install pnpm doesn't appear to work if you are on windows. Running on Linux and OSX appears to work as expected.
I've got an example file here, and the output below as an image (I'm trying to add pnpm support to Cypress.io): https://github.com/FFdhorkin/github-action/blob/feature/pnpm-support/.github/workflows/example-basic-pnpm.yml
This error we have while trying installing dependencies with ts build (dependency is another repo with prepare script) by this action.
The inferred type of "X" cannot be named without a reference to "Y". This is likely not portable. A type annotation is necessary.
Locally or on self-hosted runner all be fine. I try add node-linker=hoisted
or auto-install-peers = true
and error still exists.
But on our runner pnpm has another store directory (pnpm installed by npm install -g pnpm@7
)
// self-host runner
/home/{user}/.local/share/pnpm/store/v3`
// cloud runner with this action
/home/runner/setup-pnpm/node_modules/.bin/store/v3
And after changing store directory to same as self-host runner, the error is gone
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7
- name: Create store dir
run: mkdir -p ~/.local/share/pnpm/store/v3
- name: Reassign store dir
run: pnpm config set store-dir ~/.local/share/pnpm/store/v3
I don't know where this error, mb because path of runner contain node_modules
or something else. Hope this helps someone else
Some companies have pretty strict repository security settings, and it is currently not possible to use pnpm (in github actions) in an organization where Allow Marketplace actions by verified creators
is enabled.
I noticed that the pnpm organization has verified it's domain, so according the docs, pnpm should be able to apply for publisher verification.
Is this possible? or is there something preventing it from happening?
I've been going through multiple runs of trying to get things to publish correctly. The first issue was, pnpm_git_not_unclean
. I had that same issue awhile ago, and posted to pnpm core. It magically fixed itself so I close the issue. It's been a month with no issue, now it returns.
Okay, whatever, I updated some actions, and seems fine. Well, go to try to publish to npm a second time, says I'm not logged in... npm ERR! need auth This command requires you to be logged in to https://registry.npmjs.org/
Okay, why? The publish script has NODE_AUTH_TOKEN for it's npm token, and it's always worked before. The secret hasn't been changed.
Okay, lets try one of the different actions that I have, it runs the same setup actions, checkout, install pnpm, install node, cache, then publish. Completely different error. ERR_PNPM_GIT_UNKNOWN_BRANCH The Git HEAD may not attached to any branch, but your "publish-branch" is set to "master|main".
. What? Why is this different
A retry of the other action script gives it's own "this command requires you to be logged in" the other, with essentially the same scripts (though different activation steps) gives separate errors?
Now I just need some help on figuring out why none of this wants to work anymore.
https://github.com/cdmoro/bootstrap-vue-3/blob/main/.github/workflows/release-main.yaml -- incorrect login error
https://github.com/cdmoro/bootstrap-vue-3/blob/main/.github/workflows/npm-publish.yaml -- unknown branch error
Both with the same setup. Any guidance on how to fix these issues would be great.
Built-in pnpm modules cache manager
Reduce boilerplate statements
e.g:
- uses: pnpm/[email protected]
with:
version: latest
cache: true
The action fails on MacOS 11
https://github.com/aminya/setup-cpp/runs/6601627749?check_suite_focus=true#step:5:1
Run pnpm/action-setup@v[2](https://github.com/aminya/setup-cpp/runs/6601627749?check_suite_focus=true#step:5:2)
with:
version: 7
dest: ~/setup-pnpm
run_install: null
Running self-installer...
[stdin]:1
<!DOCTYPE html>
^
SyntaxError: Unexpected token '<'
at new Script (vm.js:88:7)
at createScript (vm.js:261:10)
at Object.runInThisContext (vm.js:[3](https://github.com/aminya/setup-cpp/runs/6601627749?check_suite_focus=true#step:5:3)09:10)
at Object.<anonymous> ([stdin]-wrapper:10:26)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at evalScript (internal/process/execution.js:9[4](https://github.com/aminya/setup-cpp/runs/6601627749?check_suite_focus=true#step:5:4):2[5](https://github.com/aminya/setup-cpp/runs/6601627749?check_suite_focus=true#step:5:5))
at internal/main/eval_stdin.js:29:5
at Socket.<anonymous> (internal/process/execution.js:207:5)
at Socket.emit (events.js:32[6](https://github.com/aminya/setup-cpp/runs/6601627749?check_suite_focus=true#step:5:7):22)
at endReadableNT (_stream_readable.js:[12](https://github.com/aminya/setup-cpp/runs/6601627749?check_suite_focus=true#step:5:13)41:12)
Error: Something went wrong, self-installer exits with code 1
Installation Completed!
My config
name: Deploy Blog
on:
push:
branches:
- main
jobs:
deploy-gh-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v2 # I try both v2 or v2.2.2
with:
version: 7
run_install: true
# ... other action
Error Message:
Run pnpm/[email protected]
Running self-installer...
Installation Completed!
Running pnpm recursive install...
Lockfile is up to date, resolution step is skipped
Progress: resolved 1, reused 0, downloaded 0, added 0
. | +575 ++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
Content-addressable store is at: /home/runner/.local/share/pnpm/store/v3
Virtual store is at: node_modules/.pnpm
Progress: resolved 575, reused 0, downloaded 21, added 19
WARN GET https://registry.npmjs.org/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.5.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
Progress: resolved 575, reused 0, downloaded 140, added 137
Progress: resolved 575, reused 0, downloaded 187, added 184
Progress: resolved 575, reused 0, downloaded 275, added 274
Progress: resolved 575, reused 0, downloaded 342, added 339
WARN GET https://registry.npmjs.org/concat-map/download/concat-map-0.0.1.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
Progress: resolved 575, reused 0, downloaded 481, added 475
Progress: resolved 575, reused 0, downloaded 5[6](https://github.com/plylrnsdy/plylrnsdy.github.io_source/actions/runs/3065146727/jobs/4948951570#step:3:7)1, added 556
Progress: resolved 575, reused 0, downloaded 572, added 572
Progress: resolved 575, reused 0, downloaded 573, added 572
Progress: resolved 575, reused 0, downloaded 573, added 573
WARN GET https://registry.npmjs.org/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.5.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
WARN GET https://registry.npmjs.org/concat-map/download/concat-map-0.0.1.tgz error (ERR_PNPM_FETCH_[40](https://github.com/plylrnsdy/plylrnsdy.github.io_source/actions/runs/3065146727/jobs/4948951570#step:3:42)4). Will retry in 1 minute. 1 retries left.
undefined
ERR_PNPM_FETCH_404 GET https://registry.npmjs.org/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.5.tgz: Not Found - 404
No authorization header was set for the request.
Error: Command pnpm recursive install (cwd: undefined) exits with status 1
I try to open these links. They actual do not exist.
https://registry.npmjs.org/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.5.tgz
https://registry.npmjs.org/concat-map/download/concat-map-0.0.1.tgz
With config:
- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 5.17.2
run_install: |
- args: [--global, typescript, ts-node]
I get the following:
Run pnpm/[email protected]
with:
version: 5.17.2
run_install: - args: [--global, typescript, ts-node]
dest: ~/setup-pnpm
bin_dest: ~/setup-pnpm/.bin
registry: https://registry.npmjs.com
env:
DOCKER_BUILDKIT: 1
Running self-installer...
Downloading https://registry.npmjs.org/pnpm/-/pnpm-5.17.2.tgz
Installation Completed!
Running pnpm install --global typescript ts-node...
ERROR EACCES: permission denied, mkdir '/usr/local/pnpm-global'
Error: Command pnpm install --global typescript ts-node (cwd: undefined) exits with status 1
In my workflow I have:
- uses: pnpm/[email protected]
with:
version: 6.0.1
run_install: true
Which causes the following error:
Run pnpm/[email protected]
with:
version: 6.0.1
run_install: true
dest: ~/setup-pnpm
bin_dest: ~/setup-pnpm/.bin
registry: https://registry.npmjs.com
Running self-installer...
Downloading https://registry.npmjs.org/pnpm/-/pnpm-6.0.1.tgz
[Error: ENOENT: no such file or directory, stat '/home/runner/setup-pnpm/bin/pnpm.js'] {
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path: '/home/runner/setup-pnpm/bin/pnpm.js'
}
This should be easy, but I won't do it because I'm lazy.
@zkochan Are you interested?
This way, we won't have to specify v2.0.1
when using the action. Let's say there is a bug fix and a version v2.0.2
is released. Then everyone who wants the version with the bug fix will have to change their workflows to use v2.0.2
. But instead if we just had to specify v2.0
, then the tag can be updated to point to the latest patch release.
This is a feature request to this action supports run pnpm@6 in node@10 environment.
I use pnpm@6 in local dev, but my package wants to support node>=10
, which break the rule of pnpm@6, engines.node >=12.
add a parameter (maybe named compiled_install
),
If true, instead of install pnpm directly, run sth like curl -f https://get.pnpm.io/v6.js | node - add --global pnpm
to setup a compiled pnpm binary as pnpm
CLI
When pnpm/action-setup
installs pnpm, the logs show:
Content-addressable store is at: /home/runner/.pnpm-store/v3
But when pnpm installs the dependencies, it logs another path:
Content-addressable store is at: /home/runner/setup-pnpm/node_modules/.bin/store/v3
The second one is correct. Is it because PNPM_HOME
is set after the installation of pnpm instead of before?
I'm not passing anything special to the actions:
- name: Install pnpm ⚙️
uses: pnpm/action-setup@v2
with:
version: 7.x
- name: Install dependencies ⚙️
run: pnpm install --frozen-lockfile
Seeing the following two warnings when using this action:
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Is this meant to work with that version? Currently getting:
Run pnpm/[email protected]
with:
version: 6.0.1
dest: ~/setup-pnpm
bin_dest: ~/setup-pnpm/.bin
registry: https://registry.npmjs.com
run_install: null
env:
PACKAGES_PATH_PREFIX: orgs/lgg
SERVICES_HOST: localhost
DOCKER_TOKEN: ***
Running self-installer...
Downloading https://registry.npmjs.org/pnpm/-/pnpm-6.0.1.tgz
[Error: ENOENT: no such file or directory, stat '/home/runner/setup-pnpm/bin/pnpm.js'] {
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path: '/home/runner/setup-pnpm/bin/pnpm.js'
}
Error: Something does wrong, self-installer exits with code 1
Installation Completed!
With the release of pnpm 8 it would be awesome to have support for it in actions.
I'm not sure, if it is a problem with this github action, but somehow my environment variables are ignored, if i use this action. If i install pnpm via npm, it works.
Example of action that is not working:
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 7
- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: 16
- name: Setup private registry
run: |
echo "NPM_CONFIG_//npm.my-company.io/:_authToken=${{ secrets.AUTH_TOKEN}}" >> $GITHUB_ENV
- name: Install Dependencies
env:
NPM_CONFIG_@my-company:registry: 'https://npm.my-company.io'
run: pnpm install
Result:
ERR_PNPM_FETCH_404 GET https://registry.npmjs.org/@my-company/core/-/core-1.2.1.tgz: Not Found - 404
So pnpm is not using the private registry, like ignoring the env config.
But if I run the following code without the action-setup, it works:
- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: 16
- name: Setup private registry
run: |
echo "NPM_CONFIG_//npm.my-company.io/:_authToken=${{ secrets.AUTH_TOKEN}}" >> $GITHUB_ENV
npm install -g pnpm@7
- name: Install Dependencies
env:
NPM_CONFIG_@my-company:registry: 'https://npm.my-company.io'
run: pnpm install
I'am playing around with pnpm on github actions and caching for faster builds.
Unfortunately after installing pnpm (btw has the right path: Content-addressable store is at: C:\Users\runneradmin\.pnpm-store\v3
) its using a diffrent one for installing: Content-addressable store is at: D:\.pnpm-store\v3
here is the last log:
https://github.com/domiSchenk/gh-action-pnpm-win-test/actions/runs/985157004
I am trying setup pnpm in a subfolder of my repository, but this is not working.
Out of curiosity, are there any non-syntax/usability benefits to using this action over doing an install with npm
?:
npm i -g pnpm@5
pnpm i --frozen-lockfile # Or `npx pnpm ...`
Or npx
?:
npx pnpm@5 i --frozen-lockfile
In the case with npx
, I'm thinking the benefit is simply that pnpm
can be used multiple times without re-installing.
I have a personnel token that helps me to read packages create by my organization.
How can I integrate it as env variable to an action.
I try to access it by secrets:
But it's not working.
Run pnpm install --no-frozen-lockfile
(https://github.com/chlbri/beme-news1-table/actions/runs/3862708222/jobs/6584443508#step:5:8)
Lockfile is up to date, resolution step is skipped
(https://github.com/chlbri/beme-news1-table/actions/runs/3862708222/jobs/6584443508#step:5:9)
Progress: resolved 1, reused 0, downloaded 0, added 0
(https://github.com/chlbri/beme-news1-table/actions/runs/3862708222/jobs/6584443508#step:5:10)
Packages: +247
[(https://github.com/chlbri/beme-news1-table/actions/runs/3862708222/jobs/6584443508#step:5:11)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(https://github.com/chlbri/beme-news1-table/actions/runs/3862708222/jobs/6584443508#step:5:12)
Packages are hard linked from the content-addressable store to the virtual store.
(https://github.com/chlbri/beme-news1-table/actions/runs/3862708222/jobs/6584443508#step:5:13)
Content-addressable store is at: /home/runner/setup-pnpm/node_modules/.bin/store/v3
(https://github.com/chlbri/beme-news1-table/actions/runs/3862708222/jobs/6584443508#step:5:14)
Virtual store is at: node_modules/.pnpm
(https://github.com/chlbri/beme-news1-table/actions/runs/3862708222/jobs/6584443508#step:5:15)
Progress: resolved 247, reused 0, downloaded 30, added 25
(https://github.com/chlbri/beme-news1-table/actions/runs/3862708222/jobs/6584443508#step:5:16)
Progress: resolved 247, reused 0, downloaded 77, added 72
(https://github.com/chlbri/beme-news1-table/actions/runs/3862708222/jobs/6584443508#step:5:17)
ERR_PNPM_FETCH_401 GET https://npm.pkg.github.com/download/@chlbri/beme-news1-core/0.1.2/c3a87044cdf2a55d54161c2d3678fd3f1228b828: Unauthorized - 401
(https://github.com/chlbri/beme-news1-table/actions/runs/3862708222/jobs/6584443508#step:5:18)
(https://github.com/chlbri/beme-news1-table/actions/runs/3862708222/jobs/6584443508#step:5:19)
An authorization header was used: ***
(https://github.com/chlbri/beme-news1-table/actions/runs/3862708222/jobs/6584443508#step:5:20)
(https://github.com/chlbri/beme-news1-table/actions/runs/3862708222/jobs/6584443508#step:5:21)
These authorization settings were found:
(https://github.com/chlbri/beme-news1-table/actions/runs/3862708222/jobs/6584443508#step:5:22)
@chlbri:registry=https://npm.pkg.github.com/
(https://github.com/chlbri/beme-news1-table/actions/runs/3862708222/jobs/6584443508#step:5:23)
//npm.pkg.github.com/:_authToken=[hidden]
(https://github.com/chlbri/beme-news1-table/actions/runs/3862708222/jobs/6584443508#step:5:24)
Error: Process completed with exit code 1.
Can you help me ?
I used the example for caching, but if my tests fail, the step for storing the pnpm store in cache fails.
Should it not run immediately after installing?
like https://github.com/actions/setup-node caching npm and yarn package
suggest a feature to cache installed package with install
Checking here I can see the install script is using https://get.pnpm.io/v6.16.js
action-setup/src/install-pnpm/run.ts
Line 25 in 10b4b0b
Given that the latest 7 version is using https://get.pnpm.io/install.sh
as the new install script, is there any change for the process? I can see that the new script is very simple and basically downloads the binary from npm.
I just release pnpm v7.0.0-alpha.0 and for some reason it doesn't work with this action. Looks like it doesn't appear in the PATH. Might be related to this: pnpm/pnpm#4280
I see two cache setups (one here and the other on setup-node) and I'm unsure which one is the latest or if either made a difference.
All the GitHub action packages have something like v2
to allow using
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: latest
Please add a v2 tag.
I tried to set the proxy for the installation via npm config and environment variable and it appears to be ignored
#- name: Set npm config http-proxy
# run: |
# npm config set proxy http://proxy:8080
# npm config set https-proxy http://proxy:8080
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
env:
https_proxy: http://proxy:8080
with:
version: 7
run_install: false
Output
12m 25s
Run pnpm/[email protected].[1](https://github.private.com/private-Global/WebMonoIcons/runs/8641?check_suite_focus=true#step:5:1)
with:
version: 7
run_install: false
dest: ~/setup-pnpm
env:
https_proxy: http://proxy:8080
Running self-installer...
FetchError: request to https://pnpm.js.org/pnpm.js failed, reason: connect ETIMEDOUT 104.[2](https://github.private.com/private-Global/WebMonoIcons/runs/8641?check_suite_focus=true#step:5:2)6.8.84:44[3](https://github.private.com/private-Global/WebMonoIcons/runs/8641?check_suite_focus=true#step:5:3)
Error: FetchError: request to https://pnpm.js.org/pnpm.js failed, reason: connect ETIMEDOUT 10[4](https://github.private.com/private-Global/WebMonoIcons/runs/8641?check_suite_focus=true#step:5:4).2[6](https://github.private.com/private-Global/WebMonoIcons/runs/8641?check_suite_focus=true#step:5:6).8.84:443
at ClientRequest.<anonymous> (/runner/_work/_actions/pnpm/action-setup/v2.0.1/dist/index.js:1:222664)
at ClientRequest.emit (events.js:314:20)
at TLSSocket.socketErrorListener (_http_client.js:42[7](https://github.private.com/private-Global/WebMonoIcons/runs/8641?check_suite_focus=true#step:5:7):9)
at TLSSocket.emit (events.js:314:20)
at emitErrorNT (internal/streams/destroy.js:92:[8](https://github.private.com/private-Global/WebMonoIcons/runs/8641?check_suite_focus=true#step:5:9))
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
type: 'system',
errno: 'ETIMEDOUT',
code: 'ETIMEDOUT'
}
Error: The operation was canceled.
In the provided caching example
- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
pnpm-lock.yaml
hash is a part of the cache key. Does it need to be? It seems that packages stored in the cache are versioned. In the integration guide for Travis it looks like the cache directory is just shared across all the builds https://pnpm.io/pl/continuous-integration#travis
First off, love pnpm ❤️
I've been gradually replacing yarn v1
with pnpm
in all of my OSS repos, and adding pnpm to GitHub actions is currently kind of ugly / verbose / error-prone.
The official actions/setup-node guide also recommends a completely different, simpler approach which doesn't seem to work. See the Caching pnpm (v6.10+) dependencies
in their guide, which uses the much simpler cache: 'pnpm'
parameter. Since this is how caching works for npm
and yarn
, I fully expected pnpm
caching to "just work" using the official actions/setup-node
guide, but it doesn't appear to.
Here's an example of the boilerplate that I'm currently using which matches the caching setup recommended by this repo's readme. As far as I can tell, the caching is taking effect, BUT it seems brittle to have this logic spread across N repositories instead of in pnpm/action-setup
and/or the official GitHub actions/setup-node
.
For maintainers with lots of repos like myself, this is an annoyance that I know will cause a maintenance burden down the line.
So I'm opening this issue to get feedback and track a better solution going forwards.
Thanks!
I want an option or version
value to use latest pnpm
version.
- uses: pnpm/action-setup@v2
with:
version: latest
I have many open source projects and it is hard to update pnpm
in all of them.
I understand that some projects need repeatability for CI. So latest
will not fit their use case. But my projects are small and for my case repeatability is not so important compare to maintainability.
We can promote exact version in docs and keep latest
only for people who need it.
Correct caching of the ~/.pnpm-store
directory would be cool.
See https://github.com/bahmutov/npm-install for one approach to get ideas from
It seems this action requires a package.json
file to be present:
action-setup/src/install-pnpm/run.ts
Lines 13 to 14 in 6e1964d
Even if users only use pnpx
and do not install packages locally, they have to provide a package.json
, which is inconvenient.
Will the action support using it without a package.json
?
We are calling it out that this action does not setup node and we have to explicitly do it, but sometimes it is not obviously enough to read through the examples till the end and find out about the warning. Instead we can add setup-node code in the README examples itself so that it becomes absolutely apparent.
Something like below:
on:
- push
- pull_request
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12
uses: actions/setup-node@v2
with:
node-version: 12
- uses: pnpm/[email protected]
with:
version: 6.0.2
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- args: [--global, gulp, prettier, typescript]
If this is okay, will raise a PR for the same.
How can I install the latest pnpm?
There's two way to specify pnpm version in package.json:
{
"packageManager": "[email protected]",
"engines": {
"pnpm": ">=6"
},
}
It should prefer packageManager field because it is more precise (this field does not support semver).
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 }}
My company has recently tightened up the security settings for Github actions and only allowing verified Github actions to be run as part of our Github workflows. Are there any plans to verify the pnpm/action-setup@v2
action on Github Marketplace?
What do you think about adding a tag v2
which points to the latest v2 release?
This tag could then also be used in the examples in the README, so that it does not have to be updated with every release.
There is a major tag for v1
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.