Skip to content

Select the release Gemfile - #89

Merged
dblock merged 1 commit into
masterfrom
dblock/release-gemfile
Nov 20, 2026
Merged

dblock merged 1 commit into
masterfrom
dblock/release-gemfile

Conversation

@dblock

@dblock dblock commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Summary

From the review of ruby-grape/grape#3078: Grape wants ruby-gem-release and commonmarker (a native Rust extension) in a release-only Gemfile, as its Danger and Duel workflows do, instead of in every contributor's and CI variant's bundle. Overriding the command inputs isn't enough, because the capture, resolve, checkpoint, preflight and failure-phase steps run bundle exec rake release:workflow:* in the default bundle that ruby/setup-ruby installs.

  • Reusable workflow: a new gemfile input (default Gemfile) sets BUNDLE_GEMFILE in the preflight and release job environments, so ruby/setup-ruby installs that bundle and every step, including the default test command, runs in it. This matches the gemfile input of Danger's reusable workflow.
  • Composite action: a matching gemfile input (default empty) is exported to GITHUB_ENV before Ruby setup. Empty keeps a BUNDLE_GEMFILE the calling job already sets, and multi-line values are rejected so they can't inject other variables.
  • Docs: the input reference, plus a Release Gemfile section with an eval_gemfile example. It notes that the selected Gemfile's lockfile must be committed or ignored (capture rejects an untracked lockfile), and that the Rakefile should rescue LoadError around the release task setup.
  • Starts 0.9.0, since 0.8.0 is published and this adds a feature.

Validation

  • bundle exec rake: RuboCop (including Markdown and spellcheck) and all unit and integration specs pass.
  • bundle exec rake build and actionlint pass.
  • New specs cover the workflow input default and both jobs' BUNDLE_GEMFILE, and the composite step's position before Ruby setup and its condition. They run the step's script to check what it exports and that it rejects a value with a line break.
  • Not validated: a real Actions run with a non-default Gemfile.

This PR was written by an AI (Claude) acting on behalf of @dblock.

🤖 Generated with Claude Code

https://claude.ai/code/session_011Gr21j6KD4oksnhmZ5u3pr

Projects that keep `ruby-gem-release` and Commonmarker out of their main
bundle could not use the reusable workflow: overriding the commands was
not enough, because capture, resolution, checkpoint, preflight, and
failure-phase steps run `bundle exec rake release:workflow:*` in the
default bundle that `ruby/setup-ruby` installs. Add a `gemfile` input
that sets `BUNDLE_GEMFILE` for both jobs before Ruby setup, and an
equivalent composite-action input exported before setup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011Gr21j6KD4oksnhmZ5u3pr
@dblock
dblock merged commit 57890ab into master Nov 20, 2026
11 checks passed
@dblock
dblock deleted the dblock/release-gemfile branch November 20, 2026 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant