-
Notifications
You must be signed in to change notification settings - Fork 257
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
Document of publish with NPM_TOKEN
not accurately while use actions/setup-node
#132
Comments
Also that's relate to #106 |
We've kinda wanted to deprecate the built-in authentication - the code for it still has to be in the project cause we don't want to release a new major version now but we should remove mentions of that from the docs. One of the problems that we have wanted to solve by that is better compatibility with Yarn Berry. They are not using |
I encountered that today, if we don't have .npmrc in .gitignore, this action generates .npmrc with no masked npm token and commit it due to this code automatically when publishing a library. It has potential risks to leak npm token if we use public repositories so that I must have replaced all npm tokens instead of leaked tokens. I think creating .npmrc should not be default behavior. Please consider it. |
I have made a POC commit and action here:
actions/setup-node
, with theregistry-url
paramsNODE_AUTH_TOKEN
forchangesets/action
There is no doubt, this commit will make action status from
success
tofailure
.Reason
As the annotation in screenshot,
actions/setup-node
with theregistry-url
params will create "user" config.npmrc
with_authToken=${NODE_AUTH_TOKEN}
,but it at
~/work/_temp/.npmrc
not~/.npmrc
, as well as theuserconfig
field point to~/work/_temp/.npmrc
.That's said in GitHub Actions Docs - Publishing packages to the npm registry.
So that
changesets/actions
create and setup_authToken
will not work.Therefore, without the
registry-url
params, the action will success (POC: action log | commit),or set the
NODE_AUTH_TOKEN
env, the action will also success (POC: action log | commit)Proposed
Maybe update the document about that case? A lot of people are using
setup-node
andregistry-url
The text was updated successfully, but these errors were encountered: