actions: [ISSUE]: GitVersion Azure DevOps Task 4.0.0 Fails with "Configuration file not found" when GitVersion.yml is Absent

Prerequisites

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

GitVersion package

AzureDevops task

What are you seeing?

After upgrading the Azure DevOps GitVersion task to version 4.x.x (e.g., GitVersion@4), our release pipelines are consistently failing with the following error:

2025-07-01T11:02:10.6509348Z ##[error]GitVersion configuration file not found at /home/vsts/work/r1/a
2025-07-01T11:02:10.6518279Z ##[error]GitVersion configuration file not found at /home/vsts/work/r1/a

This occurs despite our intention to use GitVersion’s default settings. The task appears to be explicitly searching for a GitVersion.yml file and failing if it’s not present at the specified path (/home/vsts/work/r1/a in this case). We have not made any changes to the repository’s file structure or our GitVersion task inputs besides updating the version.

What is expected?

We expect the GitVersion task (version 4.x.x) to function correctly and calculate version numbers using its default configuration when a GitVersion.yml file is not present in the repository.

In previous versions of the GitVersion Azure DevOps task, this was the standard behavior; the task would successfully execute with default settings without requiring an explicit GitVersion.yml file. The current behavior seems to deviate from this and unnecessarily mandate the presence of this configuration file.

Steps to Reproduce

Steps to Reproduce:

  • Create an Azure DevOps Release Pipeline (or Build Pipeline).
  • Add a GitVersion task to an agent job within the pipeline.
  • Ensure the task version is set to 4.x.x (e.g., GitVersion@4).
  • Do not include a GitVersion.yml file in the root of the linked Git repository artifact/source.
Image

Here is the yaml for the task

steps:
- task: gittools.gittools.execute-gitversion-task.gitversion-execute@4
  displayName: 'Execute gitversion to find the next tag'
  inputs:
    targetPath: '$(System.DefaultWorkingDirectory)/_Services.Repo/'
    disableShallowCloneCheck: true
    overrideConfig: |
     updateBuildNumber=false
     semantic-version-format=Loose
  continueOnError: true
Image
2025-07-01T11:00:53.6180467Z ##[section]Starting: Execute gitversion to find the next tag
2025-07-01T11:00:53.6188736Z ==============================================================================
2025-07-01T11:00:53.6188928Z Task         : Execute GitVersion Task
2025-07-01T11:00:53.6189005Z Description  : Easy Semantic Versioning (https://semver.org) for projects using Git
2025-07-01T11:00:53.6189163Z Version      : 4.0.0
2025-07-01T11:00:53.6189252Z Author       : GitTools Contributors
2025-07-01T11:00:53.6189328Z Help         : See the [documentation](https://gitversion.net/docs/) for help
2025-07-01T11:00:53.6189423Z ==============================================================================
2025-07-01T11:00:53.7216754Z Running on: 'Azure Pipelines'
2025-07-01T11:00:53.7221257Z Disable Telemetry
2025-07-01T11:00:53.7283446Z ##[error]GitVersion configuration file not found at /home/vsts/work/r1/a
2025-07-01T11:00:53.7292379Z ##[error]GitVersion configuration file not found at /home/vsts/work/r1/a
2025-07-01T11:00:53.7314407Z ##[section]Finishing: Execute gitversion to find the next tag

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


About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 1
  • Comments: 16 (5 by maintainers)

Commits related to this issue

Most upvoted comments

@arturcic I am getting the same error on Task version 4.0.1 (Gitversion 6.3.x) as well. Here is the job details

  • The Repository doesn’t have Gitversion.yml file
  • The Release pipeline screenshots look like this
Image
steps:

- task: gittools.gittools.setup-gitversion-task.gitversion-setup@4

  displayName: 'Setup gitversion'

  inputs:

    versionSpec: 6.3.x

    preferLatestVersion: true
Image
steps:

- task: gittools.gittools.execute-gitversion-task.gitversion-execute@4

  displayName: 'Execute gitversion to find the next tag'

  inputs:

    targetPath: '$(System.DefaultWorkingDirectory)/_Services.Tasks.Rules/'

    disableShallowCloneCheck: true

    overrideConfig: |
     updateBuildNumber=false
     semantic-version-format=Loose

  continueOnError: true

Log output after running the job

Setup gitversion

2025-07-08T09:22:37.2556533Z ##[section]Starting: Setup gitversion
2025-07-08T09:22:37.2690841Z ==============================================================================
2025-07-08T09:22:37.2693163Z Task         : Setup GitVersion Task
2025-07-08T09:22:37.2695352Z Description  : Easy Semantic Versioning (https://semver.org) for projects using Git
2025-07-08T09:22:37.2695860Z Version      : 4.0.1
2025-07-08T09:22:37.2696491Z Author       : GitTools Contributors
2025-07-08T09:22:37.2697257Z Help         : See the [documentation](https://gitversion.net/docs/) for help
2025-07-08T09:22:37.2697664Z ==============================================================================
2025-07-08T09:22:37.4502897Z Running on: 'Azure Pipelines'
2025-07-08T09:22:37.4510694Z Disable Telemetry
2025-07-08T09:22:37.4590242Z --------------------------
2025-07-08T09:22:37.4591388Z Acquiring GitVersion.Tool for version spec: 6.3.x
2025-07-08T09:22:37.4592982Z --------------------------
2025-07-08T09:22:37.4595038Z Querying tool versions for GitVersion.Tool@6.3.x 
2025-07-08T09:22:37.4599505Z Command: dotnet nuget list source --format short
2025-07-08T09:22:39.8470583Z Found matching version: 6.3.0
2025-07-08T09:22:39.8513349Z Command: dotnet tool install GitVersion.Tool --tool-path /home/vsts/work/_temp/7e923752-b1a2-444d-a59a-2d2b5fdedabe --version 6.3.0
2025-07-08T09:22:44.3761312Z --------------------------
2025-07-08T09:22:44.3761860Z GitVersion.Tool version: 6.3.0 installed.
2025-07-08T09:22:44.3762218Z --------------------------
2025-07-08T09:22:44.3762719Z Prepending /opt/hostedtoolcache/GitVersion.Tool/6.3.0 to PATH
2025-07-08T09:22:44.3777092Z Updated PATH: /opt/hostedtoolcache/GitVersion.Tool/6.3.0:/snap/bin:/home/vsts/.local/bin:/opt/pipx_bin:/home/vsts/.cargo/bin:/home/vsts/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/vsts/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
2025-07-08T09:22:44.3785802Z Set GITVERSION_PATH to /opt/hostedtoolcache/GitVersion.Tool/6.3.0
2025-07-08T09:22:44.3787163Z dotnet-gitversion installed successfully
2025-07-08T09:22:44.3797615Z GitVersion setup successfully
2025-07-08T09:22:44.3918899Z ##[section]Finishing: Setup gitversion

Execute gitversion to find the next tag

2025-07-08T09:22:44.3939550Z ##[section]Starting: Execute gitversion to find the next tag
2025-07-08T09:22:44.3945814Z ==============================================================================
2025-07-08T09:22:44.3945990Z Task         : Execute GitVersion Task
2025-07-08T09:22:44.3946072Z Description  : Easy Semantic Versioning (https://semver.org) for projects using Git
2025-07-08T09:22:44.3946254Z Version      : 4.0.1
2025-07-08T09:22:44.3946351Z Author       : GitTools Contributors
2025-07-08T09:22:44.3946435Z Help         : See the [documentation](https://gitversion.net/docs/) for help
2025-07-08T09:22:44.3946536Z ==============================================================================
2025-07-08T09:22:44.5194884Z Running on: 'Azure Pipelines'
2025-07-08T09:22:44.5200944Z Disable Telemetry
2025-07-08T09:22:44.5275032Z ##[error]GitVersion configuration file not found at /home/vsts/work/r1/a
2025-07-08T09:22:44.5294433Z ##[error]GitVersion configuration file not found at /home/vsts/work/r1/a
2025-07-08T09:22:44.5317928Z ##[section]Finishing: Execute gitversion to find the next tag