pnpm / action-setup

Install pnpm package manager
https://github.com/marketplace/actions/setup-pnpm
MIT License
899 stars 87 forks source link

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

Open pitgrap opened 2 years ago

pitgrap commented 2 years ago

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 commented 2 years ago

any resolution on this?

lucascmelo commented 1 year ago

up

lucascmelo commented 1 year ago

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