fix(rakefile): skip release:source_control_push on GitHub Actions#5
Merged
Merged
Conversation
`rubygems/release-gem@v1` hardcodes `bundle exec rake release`, and
bundler/gem_tasks' `release:source_control_push` sub-task runs:
git push origin refs/heads/<current_branch>
git push origin refs/tags/v<version>
Both fail on tag-triggered CI:
1. HEAD is detached (checked out at the tag SHA, not a branch), so
`refs/heads/HEAD does not match any` — the push aborts before ever
reaching `release:rubygem_push` (the OIDC gem-push step).
2. The tag was already pushed by the developer before the workflow ran
(that push IS the trigger). Re-pushing is redundant.
The workflow log confirms the sequence:
bybit-connector-ruby 0.1.1 built to pkg/bybit-connector-ruby-0.1.1.gem
Tagged v0.1.1.
Untagging v0.1.1 due to error.
rake aborted!
Running `git push origin refs/heads/HEAD` failed
Neutralize the sub-task on GitHub Actions only (guarded by
$GITHUB_ACTIONS) so rake release proceeds straight to rubygem_push,
which is the step that actually publishes via OIDC. Local
`bundle exec rake release` behavior is unchanged for developers.
With this fix the full release chain on CI is:
release:guard_clean → verify clean tree (CI is always clean)
release:source_control_push → NO-OP on GH Actions (this PR)
release:rubygem_push → gem push, using GEM_HOST_API_KEY set by
rubygems/release-gem's OIDC exchange
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
rubygems/release-gem@v1hardcodesbundle exec rake release, and bundler/gem_tasks'release:source_control_pushsub-task runs:Both fail on tag-triggered CI:
refs/heads/HEAD does not match any— the push aborts before ever reachingrelease:rubygem_push(the OIDC gem-push step).The workflow log confirms the sequence:
Neutralize the sub-task on GitHub Actions only (guarded by $GITHUB_ACTIONS) so rake release proceeds straight to rubygem_push, which is the step that actually publishes via OIDC. Local
bundle exec rake releasebehavior is unchanged for developers.With this fix the full release chain on CI is:
release:guard_clean → verify clean tree (CI is always clean)
release:source_control_push → NO-OP on GH Actions (this PR)
release:rubygem_push → gem push, using GEM_HOST_API_KEY set by
rubygems/release-gem's OIDC exchange