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

[MAINT]: NPM releases failing due to OTP token (2FA) requirements #2829

Closed
wolfy1339 opened this issue Mar 13, 2025 · 15 comments
Closed

[MAINT]: NPM releases failing due to OTP token (2FA) requirements #2829

wolfy1339 opened this issue Mar 13, 2025 · 15 comments
Assignees
Labels
Status: Blocked Some technical or requirement is blocking the issue Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR

Comments

@wolfy1339
Copy link
Member

wolfy1339 commented Mar 13, 2025

Moving the discussion from octokit/openapi#483 (comment)

The release workflow is failing because the token suddenly needs a one-time passcode (2FA).

https://github.com/octokit/openapi/actions/runs/13790432706/job/38568599440

npm error code EOTP
npm error This operation requires a one-time password from your authenticator.
npm error You can provide a one-time password by passing --otp=<code> to the command you ran.
npm error If you already provided a one-time password then it is likely that you either typoed
npm error it, or it timed out. Please try again.
npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2025-03-11T14_28_01_144Z-debug-0.log
@wolfy1339 wolfy1339 added Status: Blocked Some technical or requirement is blocking the issue Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR labels Mar 13, 2025
@octokit octokit deleted a comment from github-actions bot Mar 13, 2025
@wolfy1339 wolfy1339 transferred this issue from octokit/openapi Mar 18, 2025
@octokit octokit deleted a comment from github-actions bot Mar 18, 2025
@gr2m
Copy link
Contributor

gr2m commented Mar 18, 2025

I'll have a look today, I think that should be a straightforward fix

@gr2m
Copy link
Contributor

gr2m commented Mar 18, 2025

Ah I'm sorry I mixed up OTP with provenance attestation 🤦🏼 it was pre-coffee ☕

So it seems that the @octokit org on npm now enforces one-time passwords for publishing, which breaks our automated release workflow. I don't know when that happened or why. I'll try to find out but @nickfloyd might know more

@wolfy1339 wolfy1339 changed the title [MAINT]: NPM releases failing due to OTP token requirements [MAINT]: NPM releases failing due to OTP token (2FA) requirements Mar 18, 2025
@gr2m
Copy link
Contributor

gr2m commented Mar 18, 2025

I don't see a setting for it on npm. I reached out to the npm team for help

@gr2m
Copy link
Contributor

gr2m commented Mar 18, 2025

The current token we use is 5 years old, maybe updating it will resolve the problem. But I don't have access to the octokitbot npm account. @nickfloyd can you look into it?

I can try to use a token of mine for testing, but will wait on what the @octokit maintainers suggest

@nickfloyd
Copy link
Contributor

I've just regenerated the token for automation and added it to the org. I am re running the job now.

@wolfy1339
Copy link
Member Author

Re-running the job won't work since the release was already tagged on GitHub.
A new release needs to be triggered

@gr2m
Copy link
Contributor

gr2m commented Mar 18, 2025

if that happens, we can delete the tag and release notes for it manually, then re-run

@nickfloyd
Copy link
Contributor

nickfloyd commented Mar 18, 2025

Re-running the job won't work since the release was already tagged on GitHub. A new release needs to be triggered

Great point. I can't do that at the moment but I'll try to get to it after I get through my meetings unless one of y'all get to it first.

@gr2m
Copy link
Contributor

gr2m commented Mar 18, 2025

I don't see a tag for 18.2.0 though?

@gr2m
Copy link
Contributor

gr2m commented Mar 18, 2025

ah sorry I misunderstood, the 18.1.0 tag is the one that needs to be deleted, let me try that.

@oscard0m
Copy link
Member

I'm around in case you need help testing something 👋🏽

@wolfy1339
Copy link
Member Author

The release didn't trigger because it's behind the latest commit on the branch.

octokit/openapi#484 once merged should get it to trigger. It's having trouble with the update dry-run test not getting triggered

@gr2m
Copy link
Contributor

gr2m commented Mar 18, 2025

Hmm failed again

npm error code EOTP

https://github.com/octokit/openapi/actions/runs/13790432706/job/38568599440#step:5:191

I learned that 2FA can be enforced on a package level, but it's not enabled for @octokit/openapi:

Image

There is some information from people who ran into this problem in the past: semantic-release/npm#209

@nickfloyd just making sure, you created a classic token with type:automation, correct?

@nickfloyd
Copy link
Contributor

nickfloyd commented Mar 18, 2025

@nickfloyd just making sure, you created a classic token with type:automation, correct?

Yes.. updated the OCTOKITBOT_NPM_TOKEN in the org environment / actions secrets

Image

@gr2m
Copy link
Contributor

gr2m commented Mar 18, 2025

okay we figured it out, the 2FA setting was enabled for both authorization and publishing. @nickfloyd changed it to just authorization, and the release now worked via https://github.com/octokit/openapi/actions/runs/13917749582/job/38991546989

https://github.com/octokit/openapi/releases/tag/v18.1.0

@gr2m gr2m closed this as completed Mar 18, 2025
@github-project-automation github-project-automation bot moved this from 🆕 Triage to ✅ Done in 🧰 Octokit Active Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Blocked Some technical or requirement is blocking the issue Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR
Projects
None yet
Development

No branches or pull requests

4 participants