Detect whether a release is being rolled back#13
Open
mcmire wants to merge 8 commits into
Open
Conversation
If a commit is pushed which rolls back a release candidate and hence downgrades the version of the package in question, then this action will regard it as a release commit. This isn't right, and we should do something about it. However, we don't simply want to ignore this information, because it may come in handy (for instance, if we want to automatically remove the GitHub release/tag or verify the changelog in a different way). Therefore, this commit adds a new output, `COMMIT_TYPE`, which can either be `release`, `release-rollback`, or unset (not a release or a release rollback). In fact, this commit makes this output recommended and deprecates `IS_RELEASE`.
There was a problem hiding this comment.
Bug: Semver Prerelease Parsing Fails
The semver comparison script incorrectly handles prerelease versions that contain dots (e.g., "1.0.0-alpha.1"). It splits the full version string by dots before extracting the prerelease, causing parts of the prerelease identifier (like the '1' in 'alpha.1') to be incorrectly parsed as numeric version components. This leads to erroneous version comparisons.
scripts/compare-semver-versions.sh#L9-L30
action-is-release/scripts/compare-semver-versions.sh
Lines 9 to 30 in e0c2c5f
Was this report helpful? Give feedback by reacting with 👍 or 👎
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
If a commit is pushed which rolls back a release candidate and hence downgrades the version of the package in question, then this action will regard it as a release commit. Now, this doesn't affect
core(e.g. https://github.com/MetaMask/core/actions/runs/16173551572/job/45653343692) because we also pass a commit message prefix, and release rollbacks don't follow that pattern, so they get rejected by this action.However, we may actually want to know about release rollbacks. For instance, it would be useful to automatically remove the GitHub release/tag if a release is rolled back, or verify that the version being rolled back is also removed from the changelog. We can't do this well right now without repeating logic.
Therefore, this commit adds a new output,
COMMIT_TYPE, which can either berelease,release-rollback, or "normal" (not a release or a release rollback). In fact, this commit promotes this output as the one to use in the README and deprecatesIS_RELEASE.Closes #1.