-
Notifications
You must be signed in to change notification settings - Fork 78
Auto-bump version.rb from release tag #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,23 +17,29 @@ jobs: | |
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: "3.4" | ||
| bundler-cache: true | ||
|
|
||
| - name: Verify tag matches gem version | ||
| - name: Set gem version from tag | ||
| run: | | ||
| tag="${GITHUB_REF#refs/tags/v}" | ||
| version=$(ruby -r ./lib/customerio/version -e "puts Customerio::VERSION") | ||
| if [ "$tag" != "$version" ]; then | ||
| echo "::error::Tag v$tag does not match Customerio::VERSION ($version)" | ||
| exit 1 | ||
| fi | ||
| sed -i "s/VERSION = \".*\"/VERSION = \"$tag\"/" lib/customerio/version.rb | ||
| echo "Version set to $tag" | ||
|
|
||
| - name: Publish to RubyGems | ||
| uses: rubygems/release-gem@v1 | ||
|
|
||
| - name: Update version on main | ||
| run: | | ||
| 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shallow clone prevents checkout of main branchHigh Severity
Additional Locations (1)Reviewed by Cursor Bugbot for commit a6d62d6. Configure here. |
||
| sed -i "s/VERSION = \".*\"/VERSION = \"$tag\"/" lib/customerio/version.rb | ||
| git add lib/customerio/version.rb | ||
| git commit -m "Bump version to $tag [skip ci]" | ||
| git push origin main | ||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uncommitted sed change fails rake release guard_clean check
High Severity
The
sedcommand modifieslib/customerio/version.rbwithout committing it, leaving a dirty working directory. The subsequentrubygems/release-gem@v1step runsbundle exec rake release, which invokes Bundler'sguard_cleancheck. This check detects the uncommitted change and aborts, completely preventing gem publication. The project'sRakefileuses standardbundler/gem_taskswith no override of this behavior.Additional Locations (1)
.github/workflows/publish.yml#L32-L34Reviewed by Cursor Bugbot for commit a6d62d6. Configure here.