Git Product home page Git Product logo

action-setup's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

action-setup's Issues

Using pnpm/action-setup in a subdirectory of a git repoository is giving: ENOENT: no such file or directory

WHAT?

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'
  }

Specify destination

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!

`ENOENT: no such file or directory, uv_cwd` on self arm64 runner

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.

Node.js caching like `actions/setup-node`

Request

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

Motivation

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:

Before

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

After

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

Pipelines fail with `SyntaxError: Unexpected token`

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?

Error in CI: ERR_PNPM_FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE  Cannot perform a frozen installation because the lockfile needs updates

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 inferred type of "X" cannot be named without a reference to "Y". This is likely not portable. A type annotation is necessary.

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

Publisher verification

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?

publishing in ci only causes errors

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.

MacOS 11: Something went wrong, self-installer exits with code 1

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!

Fail to Install pnpm on GitHub Actions with ERR_PNPM_FETCH_404

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

run_install with --global throws permission denied

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

Error: ENOENT: no such file or directory, stat '/home/runner/setup-pnpm/bin/pnpm.js'

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'
  }

Create tag for `v2.0`

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.

Feature request: run pnpm with old version node

What

This is a feature request to this action supports run pnpm@6 in node@10 environment.

Why

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.

Detail

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

pnpm logs two different content-addressable store paths

When pnpm/action-setup installs pnpm, the logs show:

Content-addressable store is at: /home/runner/.pnpm-store/v3

image

But when pnpm installs the dependencies, it logs another path:

Content-addressable store is at: /home/runner/setup-pnpm/node_modules/.bin/store/v3

image

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

Deprecation warnings for set-state and set-output commands

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/

error when installing 6.0.1

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!

Support pnpm 8

With the release of pnpm 8 it would be awesome to have support for it in actions.

pnpm/action-setup doesn't work with private registry

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

Content-addressable is on wrong drive on windows platform

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

  • where could here be the problem?
  • are there some hard-coded links?
  • does it matter if its on D on my PC?

here is the last log:
https://github.com/domiSchenk/gh-action-pnpm-win-test/actions/runs/985157004

[Question] How does this compare to `npm i -g pnpm`?

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.

How to add personal access tokens as environment variables to a action ?

I have a personnel token that helps me to read packages create by my organization.

Capture d'écran 2023-01-07 à 15 07 08 PM

How can I integrate it as env variable to an action.

I try to access it by secrets:
Capture d'écran 2023-01-07 à 15 20 10 PM

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 ?

Pnpm 7 support

Checking here I can see the install script is using https://get.pnpm.io/v6.16.js

const response = await fetch('https://get.pnpm.io/v6.16.js')

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.

Doesn't work with pnpm v7

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

Add v2 tag

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.

install-pnpm Action ignores proxy

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.

Potential caching improvement

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

Current GH action caching boilerplate is too complex and out of sync with the official actions/setup-node

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!

Add option to use latest pnpm

I want an option or version value to use latest pnpm version.

    - uses: pnpm/action-setup@v2
      with:
        version: latest

Motivation

I have many open source projects and it is hard to update pnpm in all of them.

Side Effect

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.

Add setup-node code to examples

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.

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

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 }}

Action is not verified in Github Marketplace

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?

Add major tag `v2`

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.