Skip to content

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

@nikithamkoshy

Description

@nikithamkoshy

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions