Auto-bump version.rb from release tag#150
Conversation
Replace manual version verification with automatic injection. When a GitHub Release creates a v* tag, the workflow now sets VERSION from the tag before publishing, then commits the bump back to main.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a6d62d6. Configure here.
| tag="${GITHUB_REF#refs/tags/v}" | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git checkout main |
There was a problem hiding this comment.
Shallow clone prevents checkout of main branch
High Severity
git checkout main will fail because actions/checkout@v6 with the default fetch-depth: 1 only fetches the single commit for the tag that triggered the workflow. The main branch and its remote tracking ref origin/main are not available in the shallow clone. The checkout step needs either fetch-depth: 0 or an explicit git fetch origin main before switching branches.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit a6d62d6. Configure here.
| exit 1 | ||
| fi | ||
| sed -i "s/VERSION = \".*\"/VERSION = \"$tag\"/" lib/customerio/version.rb | ||
| echo "Version set to $tag" |
There was a problem hiding this comment.
Uncommitted sed change fails rake release guard_clean check
High Severity
The sed command modifies lib/customerio/version.rb without committing it, leaving a dirty working directory. The subsequent rubygems/release-gem@v1 step runs bundle exec rake release, which invokes Bundler's guard_clean check. This check detects the uncommitted change and aborts, completely preventing gem publication. The project's Rakefile uses standard bundler/gem_tasks with no override of this behavior.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit a6d62d6. Configure here.
|
Not needed — sticking with manual version bump PR flow. |


Summary
How it works
vX.Y.ZVERSION = "X.Y.Z"inversion.rbbeforegem buildmainTest plan
Note
Medium Risk
Changes the release workflow to rewrite
lib/customerio/version.rbfrom the pushed tag and then push a commit tomain, which can fail or cause unintended version bumps if tags/permissions are misconfigured.Overview
Release workflow now derives the gem version from the pushed
v*tag by editinglib/customerio/version.rbbefore publishing, replacing the previous tag-to-version verification step.After publishing, it checks out
mainand commits/pushes the same version bump back to the repository, automating the post-release version update.Reviewed by Cursor Bugbot for commit a6d62d6. Bugbot is set up for automated code reviews on this repo. Configure here.