Skip to content

Bump from main's version when it is newer than the newest tag - #10

Merged
mrcrgl merged 1 commit into
mainfrom
fix/bump-from-main
Nov 2, 2026
Merged

mrcrgl merged 1 commit into
mainfrom
fix/bump-from-main

Conversation

@mrcrgl

@mrcrgl mrcrgl commented Nov 2, 2026

Copy link
Copy Markdown
Member

scripts/version.sh bump counted 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 before release.yml tagged 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

  • bump counts from the newer of the newest tag and the core package's version (packages/core/package.json) on origin/main. A version merged but not tagged yet is taken, so the next regeneration gets the version after it.
  • It reads main's version, not the working tree's. A second run on the regeneration branch (the workflow's BASE == branch path) finds the version the first run bumped, already newer than the next one after main's, and keeps it: no double bump.
  • 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 fetch-depth: 0, so origin/main and every tag are there; the workflow needs no change.
  • version.test.sh covers 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/*.sh
  • scripts/version.test.sh: all cases pass; the two race cases fail against the old script (want 0.11.1, got 0.11.0).

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
mrcrgl force-pushed the fix/bump-from-main branch from e917a60 to b01a60a Compare November 2, 2026 20:03
@mrcrgl
mrcrgl merged commit df60e08 into main Nov 2, 2026
4 checks passed
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