You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cfe7964
Browse filesBrowse the repository at this point in the historyBrowse files
ruby/setup-ruby with bundler-cache installs gems into vendor/bundle,
writes .bundle/config, and creates a lockfile when none is committed,
all inside the checkout. Unless .gitignore covers them, the clean
checkout check at capture fails in every release and dry run.
Document the lines to add in the README and workflow reference. When
the check fails on this output, fold each setup directory into one line
and end the error with the exact ignore lines, so a dry run says what
to add. Other untracked or changed files are reported as before.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011Gr21htyJfr8XZGHBcPwkW
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@
7
7
-[#92](https://github.com/dblock/ruby-gem-release/pull/92): Document manual recovery from the preserved bundle when the default branch advances during publication - [@dblock](https://github.com/dblock).
8
8
-[#93](https://github.com/dblock/ruby-gem-release/pull/93): Document disabling the local Bundler `release` tasks so the workflow is the only release path - [@dblock](https://github.com/dblock).
9
9
-[#95](https://github.com/dblock/ruby-gem-release/pull/95): Rewrite the documentation in plain language, consolidating repeated rules so each lives in one place - [@dblock](https://github.com/dblock).
10
+
-[#97](https://github.com/dblock/ruby-gem-release/pull/97): Name the `.gitignore` lines to add when Ruby setup output such as `vendor/bundle` fails the clean-checkout check, including in dry runs, and document them - [@dblock](https://github.com/dblock).
10
11
-[#98](https://github.com/dblock/ruby-gem-release/pull/98): Document installing release tasks from a separate release Gemfile with `Gem.loaded_specs` instead of `rescue LoadError` - [@dblock](https://github.com/dblock).
Copy file name to clipboardExpand all lines: README.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,16 @@ With these defaults, a release:
45
45
46
46
If your Rakefile also installs the Bundler gem tasks, disable the local Bundler `release` tasks so nobody can publish around the workflow. See [Bundler Release Tasks](docs/usage.md#bundler-release-tasks).
47
47
48
+
Every release starts by checking that the checkout is clean, and Ruby setup installs gems inside it. Add what it writes to `.gitignore`, leaving out the lockfile if you commit it:
49
+
50
+
```gitignore
51
+
/vendor/bundle/
52
+
/.bundle/
53
+
/Gemfile.lock
54
+
```
55
+
56
+
With a [release Gemfile](docs/actions/release.md#release-gemfile), ignore its lockfile instead, such as `/gemfiles/release.gemfile.lock`. A [dry run](docs/actions/release.md#dry-run) fails and lists any lines that are missing.
57
+
48
58
### 2. Add the Release Workflow
49
59
50
60
Copy the [sample workflow](examples/.github/workflows/release.yml) to `.github/workflows/release.yml` and set your Ruby version:
Copy file name to clipboardExpand all lines: docs/actions/release.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ The check cannot confirm the publisher belongs to this gem, or that RubyGems wil
45
45
46
46
### Dry Run
47
47
48
-
Set `dry-run: true` to run only the [prerequisite checks](#release-prerequisites). A separate `preflight` job replaces the `release` job, in the same `release` environment, so required reviewers still approve it. It never edits, commits, tags, pushes, builds, or publishes. To dispatch dry runs, add a boolean input:
48
+
Set `dry-run: true` to run only the [prerequisite checks](#release-prerequisites). A separate `preflight` job replaces the `release` job, in the same `release` environment, so required reviewers still approve it. It never edits, commits, tags, pushes, builds, or publishes. It also checks that the checkout is clean after Ruby setup, so a dry run catches setup output such as `vendor/bundle` that `.gitignore` is missing. To dispatch dry runs, add a boolean input:
49
49
50
50
```yaml
51
51
on:
@@ -138,7 +138,7 @@ The workflow sets `GH_TOKEN` during publication. Branch rules must allow fast-fo
138
138
139
139
The job runs on `ubuntu-latest` in the `release` environment with a full checkout. Releases share one concurrency group per repository, so a new release waits rather than canceling a running one.
140
140
141
-
1. **Capture:** after Ruby setup, the checkout must be clean. Changed, staged, or untracked files fail with their paths. Ignored Bundler output is fine; tracked dependency files are not.
141
+
1. **Capture:** after Ruby setup, the checkout must be clean. Changed, staged, or untracked files fail with their paths. Ruby setup installs gems into `vendor/bundle`, writes `.bundle/config`, and creates a lockfile when none is committed; [ignore them](../../README.md#1-configure-your-gem). When they are not ignored, the error lists the `.gitignore` lines to add. Tracked dependency files are not allowed.
142
142
2. **Validate, prepare, test:** files changed by `prepare` are staged before tests. Publication rejects any later change instead of committing it. Custom bump callbacks wrap edits in `git.stage_changes!`, as in [Detailed Usage](../usage.md#custom-callbacks).
143
143
3. **Checkpoint:** the workflow commits, builds, and tags locally, then uploads [recovery artifacts](#recovery-artifacts). This must succeed before `publish` and `bump`.
144
144
4. **Publish, bump, notify:** any failure stops later steps.
"Ruby setup wrote these into the checkout; add them to .gitignore (or commit the lockfile):\n /vendor/bundle/\n /.bundle/\n /Gemfile.lock\n /gemfiles/release.gemfile.lock"
240
+
)
241
+
}
242
+
end
243
+
244
+
it'omits the lockfile advice without an untracked lockfile and the hint for other files',:aggregate_failuresdo
0 commit comments