Skip to content

[Bug] tag-prefix still seems to be optionally considered #3282

@andyfurniss4

Description

@andyfurniss4

Describe the bug
After the changes made in #3216 , I was expecting my issue with tag-prefix to be fixed but that doesn't seem to have happened. The scenario is that I am working in a repo which already has some semver tags which are used to version an API. The format of these tags are like so:

  • 2.9.0
  • 2.8.0
  • 2.7.0
  • etc

We want to create an SDK Nuget package which we want to version independently.

Expected Behavior / Actual Behavior

I thought #3216 would allow me to specify a tag-prefix in my GitVersion.yml for my SDK version, meaning the existing tags would be ignored and GitVersion would fall back to counting the commits on the main branch, resulting in an initial version of 0.1.X. However, after specifying a tag-prefix of [vV], it's still picking up the existing tags and determining the next version as 2.9.X.

Steps to Reproduce

gitversion.yml

mode: Mainline
tag-prefix: '[vV]'
branches:
  main: {}
ignore:
  sha: []

Create a bunch of semver tags with no prefix. Run GitVersion. Resulting version is not 0.1.X

Your Environment

Running in a GitHub workflow/action like so:

name: Publish SDK

on:
  push:
    branches: [ "main" ]
  workflow_dispatch:

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
      with:
        fetch-depth: 0
    
    - name: Install GitVersion
      uses: gittools/actions/gitversion/setup@v0.9.15
      with:
        versionSpec: '5.x'
        
    - name: Determine Version
      id: gitversion
      uses: gittools/actions/gitversion/execute@v0.9.15
      with:
        useConfigFile: true
        configFilePath: ./.github/gitversion.yml
  • Version Used: 5.11.1
  • Operating System and version: Ubuntu 20.04.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions