Repository navigation
Conversation
Add an opt-in isolated reusable workflow. A read-only build job runs the project's capture, validation, preparation, tests, and checkpoint, then `release:workflow:seal` commits the next development iteration locally and preserves a Git bundle and `publication.json` handoff with the gem. An environment-gated publish job checks out the library at the reusable workflow's own commit and publishes with plain Ruby, never loading the project's bundle, Rakefile, or gemspec. It verifies the handoff against the dispatched commit, then pushes the release commit before the gem, so a branch that rejects the release token fails before publication. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011Gr21j6KD4oksnhmZ5u3pr
dblock
force-pushed
the
dblock/isolated-release
branch
from
November 20, 2026 21:39
8e5d35d to
699f4d7
Compare
Owner
Author
|
Closing this. The isolation it adds doesn't cover the outcome that matters most.
Meaningful isolation would require the privileged job to rebuild the gem from the tagged source without the development bundle, or to verify it against the Git tree, similar to the reviewed workflow's content audit. That would be a separate, larger design. This comment was written by an AI (Claude) acting on behalf of @dblock. |
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.
Summary
Add an opt-in reusable workflow,
.github/workflows/isolated-release.yml, so publication credentials never coexist with project code. This addresses the security review of ruby-grape/grape#3078: the standard workflow installs the project's dev/test bundle and runs its full suite in the same job that holdsid-token: writeandcontents: write.contents: read, no environment): installs the bundle and runs capture, validate, prepare, resolve, test, and checkpoint exactly as today, then a newrelease:workflow:sealtask. Sealing prepares and commits the next development iteration locally (so hooks such as README updates still run), rewritesrelease.bundlewith the tag and both commits, and writes apublication.jsonhandoff. Everything is uploaded as the recovery artifact before publication.releaseenvironment,contents: write,id-token: write): checks out the caller at the dispatched commit and this library atjob.workflow_sha, installs no bundle (bundler: none), and runsWorkflow::IsolatedPublicationwithruby --disable-gems -I ../library/lib. It never loads the project's Gemfile, Rakefile, gemspec, or commands.gem push, then the tag, the GitHub Release, and the development commit. A branch that rejects the Actions token now fails before anything is published (review item 1). Each step reconciles existing state, so "Re-run failed jobs" resumes.hosting: nil) are used, and rejects publication-stage hooks andsuccess:/failure:callbacks the publish job cannot run.Workflow::SemanticRubyGemis supported, including generated notes andbump: false.OIDC::TrustedPublisher::GitHubAction: the workflow filename is matched against the reusable workflow's path injob_workflow_ref, so callers configureisolated-release.yml, and that publisher cannot be used by the single-job workflow. RubyGems accepts any ref, so the docs recommend SHA pinning.RubyGemRelease::RSpec::Project#isolated_release!and#publish_isolated!run the build tasks and then publish from a fresh clone in a separate plain-Ruby process with the local adapters.isolated-release.yml@vXreferences..github/actionlint.yamlnarrowly ignoresjob.workflow_repository/job.workflow_shafor this file only: both are documented by GitHub but unknown to actionlint 1.7.12 (fix: add documented job workflow context properties rhysd/actionlint#707).Validation
bundle exec rake: RuboCop (including spellcheck) and all unit and integration specs pass.bundle exec rake buildandactionlintfor.github/workflows/*.ymlandexamples/.github/workflows/*.ymlpass.Workflow::IsolatedPublicationloads withruby --disable-gems -I liband no Rake, Bundler, or Commonmarker features.Not validated: a real Actions run. The publish job's use of
job.workflow_*, artifact handoff between jobs, and OIDC exchange need a first real dispatch. Consumer CI does not exercise Actions authentication.This PR was written by an AI (Claude) acting on behalf of @dblock.
🤖 Generated with Claude Code
https://claude.ai/code/session_011Gr21j6KD4oksnhmZ5u3pr