Skip to content

ci: publish gems with RubyGems trusted publishing - #277

Merged
christoph-sg merged 1 commit into
masterfrom
ci/rubygems-trusted-publishing
Nov 30, 2026
Merged

christoph-sg merged 1 commit into
masterfrom
ci/rubygems-trusted-publishing

Conversation

@nachorpaez

@nachorpaez nachorpaez commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Replaces the long-lived RUBYGEMS_API_KEY secret with RubyGems trusted publishing (OIDC), as part of reducing static credentials in GitHub Actions.

Changes

  • release.yml (create-release job) and publish-manual.yml now call rubygems/configure-rubygems-credentials (pinned to v2.2.0). The action exchanges the job's GitHub OIDC token for a short-lived push key and exports it as GEM_HOST_API_KEY for gem push.
  • Both jobs get explicit permissions. id-token: write is needed for OIDC. contents: write (release) and contents: read (manual) keep the existing gh release steps working, because a job-level permissions block replaces the default token permissions.

Before merging

  • Trusted publishers for sourcegraph/scip-ruby, with release.yml and publish-manual.yml, are configured on scip-ruby. and scip-ruby-debug

After the first successful release

  • Delete the RUBYGEMS_API_KEY repo secret and revoke the API key on rubygems.org.

Validated with actionlint. The end-to-end path runs only on the next scip-ruby-v* tag push, or through publish-manual.yml.

Replace the static RUBYGEMS_API_KEY secret with RubyGems trusted
publishing (OIDC) in release.yml and publish-manual.yml. Both workflows
are registered as trusted publishers on rubygems.org, and
rubygems/configure-rubygems-credentials exchanges the job's GitHub OIDC
token for a short-lived push key.

Amp-Thread-ID: https://ampcode.com/threads/T-01a21ccf-6f40-71a7-a04c-06faff4f6bd8
Co-authored-by: Amp <amp@ampcode.com>
@christoph-sg
christoph-sg merged commit addfa78 into master Nov 30, 2026
10 checks passed
@christoph-sg
christoph-sg deleted the ci/rubygems-trusted-publishing branch November 30, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants