Skip to content

Remove npm auth handling in favor of docs#695

Open
bluwy wants to merge 6 commits into
mainfrom
set-up-npm-auth-docs
Open

Remove npm auth handling in favor of docs#695
bluwy wants to merge 6 commits into
mainfrom
set-up-npm-auth-docs

Conversation

@changeset-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 285bba6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@changesets/action Major

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

Comment thread docs/set-up-npm-auth.md
@bluwy bluwy changed the title Add docs for npm auth setup Remove npm auth handling in favor of docs Jul 23, 2026
Comment thread src/index.ts
"No changesets found. Attempting to publish any unpublished packages to npm",
);

if (process.env.NPM_TOKEN) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, let be it

Comment thread docs/set-up-npm-auth.md
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):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread README.md
uses: actions/setup-node@v6
with:
node-version: 26
registry-url: https://registry.npmjs.org/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given this is the default registry... i'd add a comment here

Suggested change
registry-url: https://registry.npmjs.org/
registry-url: https://registry.npmjs.org/ # makes the action to setup auth line in the config file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants