Skip to content

fix: keep a tagged branch head's prerelease version - #14

Merged
michielvha merged 1 commit into
mainfrom
fix/keep-tagged-branch-version
Nov 25, 2026
Merged

michielvha merged 1 commit into
mainfrom
fix/keep-tagged-branch-version

Conversation

@michielvha

Copy link
Copy Markdown
Owner

Problem

On a non-main branch, GitHubFlow's defaults count the next prerelease at a commit that already carries its prerelease tag. A second CI run at the same commit therefore calculates a new version, the action finds no such tag, and it tags and publishes the same commit again.

Observed through vhco-pro/version-workflow v0.1.2 on vhco-pro/ssm-connect PR #41. Run 45495839464 tagged v0.8.0-feat-shared-swift-core.2 at 6ec3c81, then a dispatch at the same commit (run 45506876260) tagged v0.8.0-feat-shared-swift-core.3 there too. main is not affected: with increment: None, its tagged head computes the same stable version.

Change

  • The bundled config sets prevent-increment.when-current-commit-tagged: true for the feature and unknown branch types, as it already does for release. The pull-request type already behaves this way.
  • A real-history test runs GitVersion 6.8.0 on feat/x, feature/x and pull/7. For each, a tagged head must compute its tag again, and the next commit must take the next prerelease number.
  • The README states that a commit that already has its version tag computes that version again.

Checks

  • GITVERSION_BINARY=<verified 6.8.0> npm test: the new test failed first on feat/x and feature/x (1.2.4-feat-x.2, expected .1); all 36 tests pass with the fix.
  • shellcheck scripts/*.sh and actionlint .github/workflows/*.yml pass.

On feature and other non-main branches, GitHubFlow's defaults counted
the next prerelease at a commit that already had its prerelease tag,
so a rerun tagged and published the same commit again. The bundled
config now keeps the tagged version there, as release branches
already did, and a real-history test covers feature, unknown and
pull-request branches.
@michielvha
michielvha merged commit 43187db into main Nov 25, 2026
3 checks passed
@michielvha
michielvha deleted the fix/keep-tagged-branch-version branch November 25, 2026 08:56
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