Skip to content

[ISSUE]: Prerelease uses branch name instead of tag name #4695

@dagophil

Description

@dagophil

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

GitVersion package

GitVersion.Tool

GitVersion version

6.4.0

Operating system

Linux

What are you seeing?

My git repo uses main as default branch and tags like v1.2.3 for versioning. Sometimes I want to create prereleases with the tags like v1.2.4-alpha0 and v1.2.4-alpha1, etc.

My preferred workflow:

  • Create feature branch from main, e.g., feature/xyz.
  • Work and do commits.
  • When ready for public testing, I tag the feature branch with a prerelease tag, e.g., 1.2.4-alpha0.
  • When running GitVersion now, it creates the SemVer 1.2.4-feature-xyz.1.

What is expected?

I expect the SemVer 1.2.4-alpha0 (or 1.2.4-alpha.0).

This used to work in earlier versions of GitVersion. (Maybe 5.12.0?)

I tried GitFlow, GitHubFlow, and TrunkBased workflows, but the output does not change.

The GitVersion.yml only contains the workflow.

If my scenario is not supported by the workflows, how can I configure GitVersion.yml to get the correct SemVers?

Steps to Reproduce

  • Create repo with main branch.
  • Add commit to main and tag it with v1.2.3.
  • Create branch feature/xyz from main.
  • Add commit to the branch and tag it with v1.2.4-alpha0.

RepositoryFixture Test

No response

Output log or link to your CI build (if appropriate).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions