-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add documentation for GET of private NPM packages #29
Comments
I don't see any npm docs saying
Note the added registry parameter for the action and the change of the env var name to NODE_AUTH_TOKEN. Without a registry parameter we don't configure auth by default. |
Thank you, noticed the mistake on the environment variable after posting this issue. |
No worries, happy to help! I wish we could have better errors for typos like this, but unfortunately since the issue is on the npm step there's not much we can do. Glad you're unblocked! I'm going to close, please comment if it should stay open! |
That's because NPM doesn't support Line 41 in 78148da
Essentially if you specify a registry,
And then npm will replace this variable at runtime. This technique is discussed in this blog post. It's too bad |
The issue here is that inputs only live for the duration of the action. So we would need to write the token directly to the .npmrc which is unsafe for security reasons.
Its worth noting that the variable we use is actually
I hadn't seen this used commonly before - it would be tough for us to change at this point though since people have already attached to |
Yeah, I guessed it was something along those lines. :) As for breaking changes... I wonder how NPM is doing the variable substitution and if we could do something fancy so if either |
Or, we could add a And, of course, you can always do: - name: npm install
if: success()
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
npm install 🙃 |
Updated message to display for origins with user variables
Getting a 404 error when trying to fetch a private NPM package. The NPM_TOKEN is included and used as a secret. Locally I also have this problem sometimes but the issue is resolved by doing a
npm login
.workflow:
The text was updated successfully, but these errors were encountered: