pascalgn / npm-publish-action

GitHub action to automatically publish packages to npm
MIT License
221 stars 29 forks source link

NPM Publish action doesn't work when using 2FA #47

Closed jfix closed 1 year ago

jfix commented 1 year ago

I have one-time passwords enabled in order to publish npm packages as recommended by NPM.

When trying to use the npm-publish-action I receive this error message:

error Couldn't publish package: "Can't answer a question unless a user TTY"

When running npm publish manually on the command line, I get challenged for the OTP:

image

Is there anything that can be done to integrate OTPs in this action?

jonmbake commented 1 year ago

You have to generate a new NPM access token and select the Automation type, which will not require OTP:

Screenshot 2023-03-19 at 5 40 55 PM
jfix commented 1 year ago

thanks @jonmbake that worked great!