Automate RubyGems releases via OIDC trusted publishing#65
Conversation
Add a release workflow that builds, tags, and publishes to RubyGems.org when lib/unit-ruby/version.rb changes on main, authenticating via OIDC trusted publishing so no API key is stored. Bump the version to 1.1.1, backfill the 1.0/1.1 changelog entries, and document the automated release flow in the README. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR adds a GitHub Actions release workflow that publishes the gem when lib/unit-ruby/version.rb changes on main (skipping if the vX.Y.Z tag exists), bumps Unit::VERSION to 1.1.1 and updates the version spec, rewrites the README releasing section for automated releases, and expands CHANGELOG.md with entries through 1.1.1. Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/release.yml:
- Around line 44-45: The workflow currently interpolates
steps.version.outputs.version directly into a shell run (used in the if test and
elsewhere) which allows command-injection via crafted version strings; add a
validation step before any run that uses steps.version.outputs.version to assert
it matches a strict semver pattern (e.g.,
^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$) and fail the job
if it does not; update the job to reference the validated output (or set a
sanitized variable) so the if test that checks git rev-parse "v${{
steps.version.outputs.version }}" only runs with a guaranteed-safe semver value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: dbbfc6e8-75c9-4c11-8b10-85c623569492
📒 Files selected for processing (5)
.github/workflows/release.ymlCHANGELOG.mdREADME.mdlib/unit-ruby/version.rbspec/version_spec.rb
Enforce a strict semver pattern when reading Unit::VERSION and pass it to
the tag-check step via env instead of ${{ }} template expansion, closing
the template-injection vector flagged by zizmor in the write-scoped
release job.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds a
release.ymlworkflow that builds, tagsvX.Y.Z, and publishes the gem to RubyGems.org automatically wheneverlib/unit-ruby/version.rbchanges onmain, authenticating via OIDC trusted publishing so no API key is stored. Bumps the version to 1.1.1 and updatesspec/version_spec.rbto match. Backfills CHANGELOG entries for the 1.0.0, 1.0.1, 1.1.0, and 1.1.1 releases (reconstructed from git history). Replaces the manualgem build/gem pushsteps in the README's Releasing section with the automated flow.🤖 Generated with Claude Code