Repository navigation
Add OTP to release script - #17
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
script/releasenow accepts--otp CODE(or--otp=CODE) and exports it asGEM_HOST_OTP_CODE, whichgem pushreads as the MFA code. Passing a TOTP code skips the WebAuthn browser handoff that RubyGems otherwise requires when MFA is enabled on the account. Omitting the flag preserves the existing WebAuthn flow.--otpor any unrecognised argument prints usage and exits before thenpm whoamipreflight, the test suite, or the gem push run.Background
With MFA set to "UI and API" on rubygems.org,
gem pushopens a localhost port, prints awebauthn_verificationURL, and waits up to 5 minutes for the browser to complete a passkey and redirect back. That handoff is fragile (passkey in the wrong browser, blocked localhost redirect, or the window expiring whilescript/cibuildruns). RubyGems already honoursGEM_HOST_OTP_CODEas an alternative, so the script just surfaces it as a flag.Test plan
sh -n script/releasepasses.--otp 123456and--otp=654321set the variable, no argument leaves it unset, and--otpalone or a bogus argument exit 1 with the usage line.script/release --otp <code>on the next version bump.Notes
npm publishstill prompts for its own code interactively.🤖 Generated with Claude Code