forked from Kirachon/context-engine
-
Notifications
You must be signed in to change notification settings - Fork 1
fix: auto-bump patch version in release workflow #4
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
🏁 Script executed:
cat -n .github/workflows/release.yml | head -150Repository: rishitank/context-engine
Length of output: 6379
🏁 Script executed:
cat -n .github/workflows/release.yml | tail -100Repository: rishitank/context-engine
Length of output: 4105
🏁 Script executed:
cat Cargo.toml | head -20Repository: rishitank/context-engine
Length of output: 582
🏁 Script executed:
Repository: rishitank/context-engine
Length of output: 107
🏁 Script executed:
Repository: rishitank/context-engine
Length of output: 1009
🏁 Script executed:
Repository: rishitank/context-engine
Length of output: 859
Validate version format and prevent concurrent auto-bump conflicts.
The auto-bump logic contains confirmed critical and major issues:
Pre-release version handling: If
CURRENT_VERSIONcontains pre-release identifiers (e.g.,1.2.3-beta.1), the version parsing at lines 113 and 73 will fail silently. TheIFS='.'split assigns"3-beta"toPATCH, and bash arithmetic treats the non-numeric"3-beta"as 0, resulting in an incorrect version1.2.1instead of1.2.4-beta.1. The workflow supports pre-release versions viainputs.prerelease, making this a real vulnerability.Missing NEW_VERSION validation: After computing
NEW_VERSIONat line 114, there is no check to verify that tagv$NEW_VERSIONdoes not already exist. OnlyCURRENT_VERSIONis checked at line 110.Race condition with concurrent workflow_run: Multiple
workflow_runinstances triggered by rapid commits will both read the sameCURRENT_VERSIONfrom line 57 before the first job'sbump-versionstep completes, causing both to compute and attempt to push the identicalNEW_VERSION. Although the release job at line 441 skips tag creation if it exists, the check job has already outputshould_release=truefor both instances, creating an inconsistent state.Add version format validation and NEW_VERSION tag existence check before computing the bump.