Skip to content

UseGitVersion task needs config file to be specified #2094

Closed
@phatcher

Description

@phatcher

Changed over to the new DevOps task, but it fails to pick up the config file

- task: UseGitVersion@5
  displayName: 'GitVersion'
  inputs:
    versionSpec: '5.x'
    updateAssemblyInfo: false

This runs
/opt/hostedtoolcache/GitVersion.Tool/5.1.3/x64/dotnet-gitversion /home/vsts/work/1/s /output buildserver /nofetch

And I get the wrong version number e.g. 0.2.0+55 since it doesn't pick up the config file

Change this to

- task: UseGitVersion@5
  displayName: 'GitVersion'
  inputs:
    versionSpec: '5.x'
    updateAssemblyInfo: false
    useConfigFile: true
    configFilePath: './gitversion.yml'

and we get
/opt/hostedtoolcache/GitVersion.Tool/5.1.3/x64/dotnet-gitversion /home/vsts/work/1/s /output buildserver /nofetch /config /home/vsts/work/1/s/gitversion.yml

which then correctly computes the build number.

I'd expect it to pick up the standard configuration file without being told?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions