-
Notifications
You must be signed in to change notification settings - Fork 0
Fix nothing to commit when release version #94
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
Conversation
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.
Pull Request Overview
This PR fixes an issue where the release workflow fails with "nothing to commit" when the local version in pyproject.toml is already at the target release version. The changes prevent unnecessary version bumps and handle cases where the local version is ahead of the published version.
- Adds logic to check current local version in pyproject.toml and compare it with published versions
- Modifies version bump logic to skip updates when the version is already at target
- Updates commit logic to handle cases where no version change is needed
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/scripts/get_next_release_version.sh | Enhanced version detection to read from pyproject.toml and handle cases where local version is ahead |
| .github/workflows/release-prepare.yml | Added conditional version bumping and commit logic to avoid "nothing to commit" errors |
| echo "Expected format: MAJOR.MINOR.PATCH" | ||
| exit 1 | ||
| # Use version comparison to check if local is ahead | ||
| if printf '%s\n%s\n' "$LATEST_RELEASE_VERSION" "$CURRENT_LOCAL_VERSION" | sort -V | tail -n1 | grep -q "^$CURRENT_LOCAL_VERSION$"; then |
Copilot
AI
Jul 28, 2025
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.
This version comparison logic is complex and hard to understand. Consider extracting it into a function with a descriptive name like is_version_greater_or_equal to improve readability and maintainability.
| if printf '%s\n%s\n' "$LATEST_RELEASE_VERSION" "$CURRENT_LOCAL_VERSION" | sort -V | tail -n1 | grep -q "^$CURRENT_LOCAL_VERSION$"; then | |
| if is_version_greater_or_equal "$CURRENT_LOCAL_VERSION" "$LATEST_RELEASE_VERSION"; then |
| fi | ||
|
|
||
| # Only calculate new version if we haven't already set it from local version | ||
| if [ -z "${NEW_VERSION:-}" ]; then |
Copilot
AI
Jul 28, 2025
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.
[nitpick] The conditional check for NEW_VERSION being unset creates complex nested logic. Consider restructuring the code flow to use early returns or separate functions to reduce nesting and improve readability.
| - Version already at $VERSION | ||
| - Prepare for release |
Copilot
AI
Jul 28, 2025
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.
[nitpick] The commit message spans multiple lines but uses different formatting than the previous commit message. Consider using consistent formatting for both commit messages to maintain uniformity.
| - Version already at $VERSION | |
| - Prepare for release | |
| - Bump version to $VERSION | |
| - Update package metadata |
No description provided.