Skip to content

Commit 4aeab9d

Browse files
authored
Fix OTP_TOKEN generation code in CI
1 parent 373b88d commit 4aeab9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
5858
# TODO: If it is possible to accept input in the middle of a step, then the OTP Token should be inputted instead of generated.
5959
gem install rotp -v 6.2.0
60-
OTP_TOKEN=$(ruby -rtime -rrotp -e "puts ROTP::TOTP.new('${OTP_SECRET}', issuer: 'rubygems.org').at(Time.now)")
60+
OTP_TOKEN=$(echo ${OTP_SECRET} | ruby -rtime -rrotp -e "puts ROTP::TOTP.new(STDIN.read.chomp, issuer: 'rubygems.org').at(Time.now)")
6161
gem push --otp="${OTP_TOKEN}" ./build/gems/*.gem
6262
env:
6363
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"

0 commit comments

Comments
 (0)