-
Notifications
You must be signed in to change notification settings - Fork 34
Fix release workflow to use OIDC credentials directly #429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Replace rubygems/release-gem with manual build and push to avoid the rake release task attempting git operations (which fails due to insufficient permissions in the publish job). - Use rubygems/configure-rubygems-credentials for OIDC auth - Run rake build to create the gem without git operations - Push directly with gem push Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Greptile OverviewGreptile SummaryThis PR fixes the release workflow by replacing the Key Changes
AnalysisThe solution properly separates concerns: git operations run in the Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant PR as Pull Request
participant CRJ as create-release Job
participant GH as GitHub API
participant PJ as publish Job
participant OIDC as RubyGems OIDC
participant RG as RubyGems
PR->>CRJ: PR merged with version-bump label
CRJ->>CRJ: Generate GitHub App token
CRJ->>CRJ: Checkout repository
CRJ->>CRJ: Extract version from version.rb
CRJ->>GH: Create GitHub release with tag
CRJ->>PJ: Pass version output
PJ->>OIDC: Configure credentials (role-to-assume)
OIDC-->>PJ: OIDC authentication complete
PJ->>PJ: Checkout repository
PJ->>PJ: Setup Ruby 3.2
PJ->>PJ: Run bundle exec rspec
PJ->>PJ: Run bundle exec rake build
PJ->>RG: gem push pkg/workos-{version}.gem
RG-->>PJ: Gem published successfully
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 1 comment
| - name: Configure RubyGems credentials | ||
| uses: rubygems/configure-rubygems-credentials@main | ||
| with: | ||
| role-to-assume: rg_oidc_akr_fn8dx45asckvmsnd2kka |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider pinning rubygems/configure-rubygems-credentials to a specific version tag instead of @main to prevent unexpected changes
| - name: Configure RubyGems credentials | |
| uses: rubygems/configure-rubygems-credentials@main | |
| with: | |
| role-to-assume: rg_oidc_akr_fn8dx45asckvmsnd2kka | |
| - name: Configure RubyGems credentials | |
| uses: rubygems/configure-rubygems-credentials@v1 | |
| with: | |
| role-to-assume: rg_oidc_akr_fn8dx45asckvmsnd2kka |
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/release.yml
Line: 56:59
Comment:
Consider pinning `rubygems/configure-rubygems-credentials` to a specific version tag instead of `@main` to prevent unexpected changes
```suggestion
- name: Configure RubyGems credentials
uses: rubygems/configure-rubygems-credentials@v1
with:
role-to-assume: rg_oidc_akr_fn8dx45asckvmsnd2kka
```
How can I resolve this? If you propose a fix, please make it concise.
Summary
rubygems/release-gemwith manual build and pushrubygems/configure-rubygems-credentialsfor OIDC authenticationrake buildinstead ofrake releaseto avoid git operationsProblem
The
rubygems/release-gemaction runsbundle exec rake release, which includesrelease:source_control_pushthat tries to push git tags. The publish job only hascontents: readpermission, causing the workflow to fail with:The previous fix attempted to use a
gem-push-commandinput, but that input doesn't exist in therubygems/release-gemaction.Solution
Use
rubygems/configure-rubygems-credentialsto set up OIDC auth, then manually:bundle exec rake build- builds the gem without git operationsgem push- pushes to RubyGemsTest plan
🤖 Generated with Claude Code