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

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

Open
pitgrap opened this issue Jul 1, 2022 · 3 comments
Open

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

pitgrap opened this issue Jul 1, 2022 · 3 comments

Comments

@pitgrap
Copy link

pitgrap commented Jul 1, 2022

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
@axelyung
Copy link

any resolution on this?

@lucascmelo
Copy link

up

@lucascmelo
Copy link

on Setup NodeJS I added the secrets.PAT and works.
Also my .npmrc has the registry @my-company:registry=https://npm.pkg.github.com

- name: Setup Node.js
      uses: actions/setup-node@v2
      with:
        node-version: '14'
        registry-url: 'https://npm.pkg.github.com'
        check-latest: true
      env:
        NODE_AUTH_TOKEN: ${{ secrets.PAT }}

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

3 participants