Skip to content

fix: stash uncommitted changes before gem bump - #286

Open
ronaldtse wants to merge 1 commit into
metanorma:mainfrom
ronaldtse:fix/stash-before-gem-bump
Open

fix: stash uncommitted changes before gem bump#286
ronaldtse wants to merge 1 commit into
metanorma:mainfrom
ronaldtse:fix/stash-before-gem-bump

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Problem

Follow-up to #285. The rm -f Gemfile.lock fix was insufficient — bundle install with bundler-cache also creates vendor/bundle/ and .bundle/config as untracked files, causing gem bump to still abort.

Fix

Use git stash --include-untracked instead of removing a specific file. This temporarily hides ALL uncommitted changes (tracked modifications, untracked files, and gitignored files) before gem bump runs.

This is safe because:

  • gem bump commits and pushes its own version bump — it does not need the stashed content
  • The stash is temporary and does not affect the pushed commit
  • Does NOT delete any files (unlike git clean), so generated frontend assets and other build artifacts remain in the stash if needed later in the workflow

Testing

Failed with just rm -f Gemfile.lock: https://github.com/lutaml/moxml/actions/runs/26732999948

gem bump requires a clean working tree but CI steps like bundle
install create untracked files (Gemfile.lock, vendor/bundle,
.bundle/config). Previous fix only removed Gemfile.lock but
bundle config also writes to vendor/bundle and .bundle/config.

Use git stash --include-untracked to hide all uncommitted changes
before bumping. This is safe because gem bump commits and pushes
its own changes — the stash is only needed to satisfy the clean
tree check.
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