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

Question about npm publishing with 2FA on #7

Closed
oatymart opened this issue Jul 20, 2020 · 3 comments
Closed

Question about npm publishing with 2FA on #7

oatymart opened this issue Jul 20, 2020 · 3 comments
Labels
question Further information is requested

Comments

@oatymart
Copy link

Hi,
before trying, I would like to know if it's possible to use this action when you have 2FA configured on your npm account?
When I publish manually using npm publish, I'm prompted for my OTP. Will this prevent the action from completing?

@JamesMessinger
Copy link
Member

I have 2FA enabled for my NPM account, and this action works great for me. But I think you can also enable a stricter form of 2FA in NPM, where the OTP has to be re-entered every time you publish a package, and I'm not sure whether this action will work in that case.

@JamesMessinger JamesMessinger added the question Further information is requested label Jul 20, 2020
@oatymart
Copy link
Author

Sadly under my npm organisation's current publishing settings, this action fails with:

npm ERR! code EOTP
npm ERR! This operation requires a one-time password from your authenticator.
npm ERR! You can provide a one-time password by passing --otp=<code> to the command you ran.
npm ERR! If you already provided a one-time password then it is likely that you either typoed
npm ERR! it, or it timed out. Please try again.

Since there doesn't seem to be any workaround offered by npm, having 2FA-for-publishing and publishing via an action seems to be, as expected, a no-go.

@yordis
Copy link

yordis commented Sep 16, 2021

I think this should be close,

NPM has a token type for integrations such as CI/CD that will bypass 2MFA.

Screen Shot 2021-09-16 at 12 00 48 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants