Repository navigation
ci: publish to RubyGems via trusted publishing (OIDC) - #158
Merged
Merged
Conversation
The RubyGems account enforces MFA, so `gem push` with the RUBYGEMS_AUTH_TOKEN secret cannot complete unattended (the run hangs on the WebAuthn/OTP prompt, then times out). Switch to RubyGems Trusted Publishing: GitHub Actions exchanges its OIDC token for a short-lived, gem-scoped credential, so no long-lived secret is needed. - Use rubygems/configure-rubygems-credentials@v2.1.0 and grant `id-token: write` on the publish job - Add a job timeout so an auth failure fails fast instead of hanging - Only run the publish job on a manual dispatch when a tag is supplied - Use googleapis/release-please-action and drop the invalid package-name/version-file inputs Also declare `release-type` and `version-file` in release-please-config.json so release PRs bump lib/rotp/version.rb (they have not since 6.3.0).
This was referenced Oct 29, 2026
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.
Why
The RubyGems account enforces MFA, so the
gem pushstep from #157 cannot complete unattended — the run hangs on the WebAuthn/OTP prompt until it is cancelled (confirmed in run 40903368260).What
id-token: writeon the publish job;rubygems/configure-rubygems-credentials@v2.1.0beforegem push.timeout-minutes: 20so auth failures fail fast instead of hanging.tagis provided.googleapis/release-please-actionand drop the invalidpackage-name/version-fileaction inputs.release-typeandversion-fileinrelease-please-config.jsonso release PRs bumplib/rotp/version.rb(missing since 6.3.0 — that's why the stale 6.3.1 PR never bumped it).One-time setup (outside this PR)
On rubygems.org, add a trusted publisher for the rotp gem:
mdprotprelease.yamlOnce configured, the existing
RUBYGEMS_AUTH_TOKENsecret can be deleted.