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

Publish not working for internal Artifactory registry #336

Open
brad-mccormick opened this issue Nov 27, 2023 · 4 comments
Open

Publish not working for internal Artifactory registry #336

brad-mccormick opened this issue Nov 27, 2023 · 4 comments

Comments

@brad-mccormick
Copy link

In my GitHub Workflow I'm creating a .npmrc with connection info for our internal Artifactory registry and then executing the changesets action. It fails on running the pnpm changesets publish command with an "incorrect or missing password" and to run npm login. The documentation states that in the presence of a .npmrc, that user defined registry info is used instead. So why does it seem that its failing to use it and expecting an NPM_TOKEN? Here's an excerpt from the failed workflow:

No changesets found, attempting to publish any unpublished packages to npm
Found existing user .npmrc file
Didn't find existing auth token for the npm registry in the user .npmrc file, creating one
/home/runner/setup-pnpm/node_modules/.bin/pnpm run changeset:release 
@MikelArnaiz
Copy link

Provide an example of your .npmrc file

@uiolee
Copy link

uiolee commented Jan 19, 2024

same issue

@uiolee
Copy link

uiolee commented Jan 19, 2024

return /^\s*\/\/registry\.npmjs\.org\/:[_-]authToken=/i.test(line);

Didn't find existing auth token for the npm registry in the user .npmrc file, creating one

the code just check npmjs token, which is the problem

@nikparo
Copy link

nikparo commented Jan 27, 2024

I got a similar error in a monorepo using pnpm (You need to authorize this machine using npm adduser), and in my case it was because I had defined a publish script in package.json, which I tried running in the changeset action as pnpm publish. The problem is that publish is a built in command, so to run the script you would need pnpm run publish. I opted to rename the script instead.

package.json:

{
  "scripts": {
-    "publish": "pnpm build && pnpm changeset publish",
+    "publish-changeset": "pnpm build && pnpm changeset publish",
  }
}

.github/workflows/release.yaml:

      - name: "Create Release Pull Request or Publish to GCP"
        id: changesets
        uses: changesets/action@v1
        with:
-          publish: pnpm publish
+          publish: pnpm publish-changeset
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

4 participants