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
Allow setting --otp
via GEM_HOST_OTP_CODE
#4697
Conversation
Thanks for opening a pull request and helping make RubyGems and Bundler better! Someone from the RubyGems team will take a look at your pull request shortly and leave any feedback. Please make sure that your pull request has tests for any changes or added functionality. We use GitHub Actions to test and make sure your change works functionally and uses acceptable conventions, you can review the current progress of GitHub Actions in the PR status window below. If you have any questions or concerns that you wish to ask, feel free to leave a comment in this PR or join our #rubygems or #bundler channel on Slack. For more information about contributing to the RubyGems project feel free to review our CONTRIBUTING guide |
I think this can be useful, yeah! But shouldn't the CLI flag still take precedence over the environment variable? @sonalkr132 What do you think about this? |
@deivid-rodriguez I think that is also reasonable. I went with ENV first as that matches the behaviour of |
Oh, I see! In my opinion that's a bug in |
That makes sense, explicit cli options should take precedence over environment variables 👍🏼 I'll fix the precedence here and I can also likely get a PR to fix for api_key up as well! |
For release automation it can be nice to want to pass in the OTP via some UI (e.g. a workflow_dispatch input on GitHub Actions) and then just be able to run `rake release` to publish to rubygems. This introduces a new environment variable `GEM_HOST_OTP_CODE` which will be checked if the `--otp` command line option is not set, allowing for automated releases with OTP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
LGTM. Thanks you @CGA1123 |
--otp
via GEM_HOST_OTP_CODE
Thanks! ❤️ |
Allow setting `--otp` via `GEM_HOST_OTP_CODE` (cherry picked from commit 51184aa)
Hi there, thank you so much for shipping this feature! I have really wanted it. 🥰 BTW, I cannot find a description about |
PR welcome! |
@deivid-rodriguez Thanks. I've created PR #4742. |
What was the end-user or developer problem that led to this PR?
For release automation it can be nice to want to pass in the OTP via
some UI (e.g. a workflow_dispatch input on GitHub Actions) and then just
be able to run
rake release
to publish to rubygems.What is your fix for the problem, implemented in this PR?
This introduces a new environment variable
GEM_HOST_OTP_CODE
whichwill take precendence over
--otp
command line options, allowing forautomated releases with OTP.
Make sure the following tasks are checked