Skip to content

fix: bump-version.sh correctly handles prerelease versions#225

Open
davidweb3-ctrl wants to merge 1 commit intoCortexLM:mainfrom
davidweb3-ctrl:fix-prerelease-bump
Open

fix: bump-version.sh correctly handles prerelease versions#225
davidweb3-ctrl wants to merge 1 commit intoCortexLM:mainfrom
davidweb3-ctrl:fix-prerelease-bump

Conversation

@davidweb3-ctrl
Copy link
Copy Markdown

Summary

Fixes bug where bumping from a prerelease version would incorrectly increment and skip the stable release.

Bug Description

When running bump-version.sh on a prerelease version like 1.0.0-beta.1:

  • Before: 1.0.0-beta.1 + patch → 1.0.1 (WRONG - skips 1.0.0)
  • After: 1.0.0-beta.1 + patch → 1.0.0 (CORRECT - stable release)

Changes

  • Detect if current version contains prerelease tag (contains -)
  • For prerelease versions: patch/minor/major bumps return base stable version
  • For stable versions: behavior unchanged (normal semver increment)

Test Cases

Current Version Bump Type Before Fix After Fix
1.0.0-beta.1 patch 1.0.1 ❌ 1.0.0 ✅
1.0.0-beta.1 minor 1.1.0 ❌ 1.0.0 ✅
1.0.0-beta.1 major 2.0.0 ❌ 1.0.0 ✅
1.0.0 patch 1.0.1 ✅ 1.0.1 ✅
1.0.0 minor 1.1.0 ✅ 1.1.0 ✅

Related

When bumping from a prerelease version (e.g., 1.0.0-beta.1),
the script now correctly transitions to the stable version
instead of incrementing and skipping the stable release.

Changes:
- Detect if current version is a prerelease (contains '-')
- For prerelease versions: patch/minor/major bumps now return
the base stable version (e.g., 1.0.0-beta.1 -> 1.0.0)
- For stable versions: behavior unchanged (normal increment)

Fixes: PlatformNetwork/bounty-challenge#47839
Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

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