Hi Govardhan Reddy,
Instead of using the GitHub Actions version (gitversion/setup@3
and gitversion/execute@3
),
Use the official GitVersion Azure DevOps extension tasks:
These are designed for Azure Pipelines and do not have the same issues.
-
gittools.gitversion.setup@0
-
gittools.gitversion.execute@0
Here’s the corrected YAML:
trigger:
- main
pool:
name: Self-Hosted-Agent-Pool
steps:
- task: gittools.gitversion.setup@0
inputs:
versionSpec: '5.x'
- task: gittools.gitversion.execute@0
inputs:
useConfigFile: true
configFilePath: './git-version.yaml'
- script: echo "##vso[build.updatebuildnumber]$(GitVersion.FullSemVer)"
displayName: 'Set Build Number'
The gittools.gitversion.setup@0
and gittools.gitversion.execute@0
tasks are maintained specifically for Azure DevOps Pipelines, independent of GitHub Actions releases.
Reference: Official GitVersion Azure DevOps Extension on Visual Studio Marketplace
This method fully resolves the issue, and you’ll be able to run GitVersion successfully on your pipelines.
Hope it helps!
Please do not forget to click "Accept the answer” and Yes
wherever the information provided helps you, this can be beneficial to other community members.
If you have any other questions or still running into more issues, let me know in the "comments" and I would be happy to help you.