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

Add support for YubiKey OTP codes during release #43863

Merged
merged 1 commit into from
Dec 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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