Remove npm auth handling in favor of docs#695
Conversation
🦋 Changeset detectedLatest commit: 285bba6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| "No changesets found. Attempting to publish any unpublished packages to npm", | ||
| ); | ||
|
|
||
| if (process.env.NPM_TOKEN) { |
There was a problem hiding this comment.
NPM_TOKEN, IIRC, isn't actually a universal env variable (unlike e.g. NODE_AUTH_TOKEN). It's worth rechecking that - but if it was our invention, then perhaps we should throw when it's set, to make the migration easier.
There was a problem hiding this comment.
NPM_TOKEN is a fairly common token name I think, but it being passed to the action is probably the only special part. I'm a bit wary of validating this though since custom publish scripts might want to access this? Worst case the npm publish would also fail anyways so this would only be an early error if implemented. So maybe it's fine leaving as is.
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # pass the token here | ||
| ``` | ||
|
|
||
| Internally, `actions/setup-node` will set up a configuration like below in `~/.npmrc` (in the home directory): |
There was a problem hiding this comment.
as we've learned, it actually won't be in ~/.npmrc:
https://github.com/actions/setup-node/blob/32f57ac043e003bc1b07edcb2b9102bbbf3e92f1/src/authutil.ts#L48
we probably should vaguely mention that, or at least not mention ~/.npmrc as that sets up the wrong expectation
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 26 | ||
| registry-url: https://registry.npmjs.org/ |
There was a problem hiding this comment.
given this is the default registry... i'd add a comment here
| registry-url: https://registry.npmjs.org/ | |
| registry-url: https://registry.npmjs.org/ # makes the action to setup auth line in the config file |
Issues:
NPM_TOKENnot accurately while use actions/setup-node #132PRs:
.npmrcfiles. #529