Repository navigation
Bump from main's version when it is newer than the newest tag - #10
Merged
Merged
Conversation
scripts/version.sh bump counted from the newest tag alone. A regeneration pull request made after another set the version and merged, but before the release workflow tagged it, got that same version, so its changes would be in no release. This happened in the Terraform provider (origincloudhq/terraform-provider-origincloud#15). A version merged but not tagged yet is taken too, so bump now counts from the core package's version (packages/core/package.json) on origin/main when that is newer than the newest tag. It counts from main's version, not the working tree's, so a second run on the regeneration branch, which holds the version the first run bumped, doesn't bump it twice. Without origin/main, as in a clone that hasn't fetched it, it counts from the newest tag as before. The regeneration workflow checks out main with its full history, so origin/main is there. version.test.sh covers main ahead of the newest tag, a branch bumped already, main at the newest tag, and main behind it.
mrcrgl
force-pushed
the
fix/bump-from-main
branch
from
November 2, 2026 20:03
e917a60 to
b01a60a
Compare
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.
scripts/version.sh bumpcounted up from the newest tag alone, and kept the current version when the result wasn't newer. A version merged on main but not tagged yet didn't count: a regeneration pull request made after another merged, but beforerelease.ymltagged it, got the same version, and its changes would be in no release. This happened in the Terraform provider, where origincloudhq/terraform-provider-origincloud#15 kept the 0.4.0 the regeneration before it had set.What changed
bumpcounts from the newer of the newest tag and the core package's version (packages/core/package.json) onorigin/main. A version merged but not tagged yet is taken, so the next regeneration gets the version after it.BASE == branchpath) finds the version the first run bumped, already newer than the next one after main's, and keeps it: no double bump.origin/main, as in a clone that hasn't fetched it, it counts from the newest tag as before. The regeneration workflow checks outmainwithfetch-depth: 0, soorigin/mainand every tag are there; the workflow needs no change.version.test.shcovers main ahead of the newest tag (the race), a branch that bumped already, main at the newest tag, and main behind it.Tested
shellcheck scripts/*.shscripts/version.test.sh: all cases pass; the two race cases fail against the old script (want 0.11.1, got 0.11.0).