Skip to content

Commit

Permalink
Merge pull request #43863 from rails/yubikey-support
Browse files Browse the repository at this point in the history
Add support for YubiKey OTP codes during release
  • Loading branch information
tenderlove committed Dec 14, 2021
1 parent 69e2e89 commit d629272
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tasks/release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,26 @@
end

task push: :build do
sh "gem push #{gem}"
otp = ""
begin
otp = " --otp " + `ykman oath accounts code -s rubygems.org`.chomp
rescue
# User doesn't have ykman
end

sh "gem push #{gem}#{otp}"

if File.exist?("#{framework}/package.json")
Dir.chdir("#{framework}") do
npm_tag = /[a-z]/.match?(version) ? "pre" : "latest"
sh "npm publish --tag #{npm_tag}"
npm_otp = ""
begin
npm_otp = " --otp " + `ykman oath accounts code -s npmjs.com`.chomp
rescue
# User doesn't have ykman
end

sh "npm publish --tag #{npm_tag}#{npm_otp}"
end
end
end
Expand Down

0 comments on commit d629272

Please sign in to comment.