Repository navigation
ci: publish to RubyGems with Trusted Publishing from master - #232
Merged
Merged
Conversation
mogita
requested review from
JimmyPettersson85,
nijeesh-stream,
shaljam and
vishalnarkhede
as code owners
November 18, 2026 13:46
mogita
commented
Nov 18, 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.
Submit a pull request
CLA
Description of the pull request
The release job pushes the gem with the long-lived
RUBYGEMS_API_KEYsecret, which may have been exposed in the GitHub Actions secret incident. This switches the push to RubyGems Trusted Publishing: the publish job exchanges its OIDC token for a short-lived RubyGems API key, so the repo no longer needs a RubyGems secret.masterinstead of on the closed release PR. Acheckjob releases while theVERSIONfromlib/stream-chat/version.rbwas never pushed to RubyGems, which is the case right after a release PR is squash-merged. A published or yanked version skips the release, and any other RubyGems answer fails the run. The release is always the commit that setVERSION, so a rerun or a later push publishes the reviewed release PR and nothing merged after it. An existing tag for the version must point at that commit, or the run fails. Release runs are serialized, so overlapping pushes cannot build the same version twice.buildruns checkout, the changelog script andgem buildwithcontents: readand uploads the gem.releasecreates the tag and GitHub release on the released commit withcontents: write, before the push, and keeps them on a rerun.publishis the only job withid-token: write. It downloads the gem and runsrubygems/configure-rubygems-credentialsandgem push, in therubygemsenvironment. That environment allowsmasteronly, and the RubyGems trusted publisher forstream-chat-rubyrequires it, so a branch with an editedrelease.ymlcannot publish. Every action in the workflow is pinned to a commit.The release process in
CONTRIBUTING.mdis unchanged: runinitiate_release, then squash-merge the release PR.How to verify: the merge of this PR runs
checkwithrelease=false(3.27.1 is on RubyGems) and skips the rest. The next release PR merge publishes to RubyGems withoutRUBYGEMS_API_KEY. After that, theRUBYGEMS_API_KEYsecret is removed.