Skip to content

[ISSUE]: GitVersion output is not valid JSON #1549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
will-scc opened this issue Mar 31, 2025 · 0 comments
Open
2 tasks done

[ISSUE]: GitVersion output is not valid JSON #1549

will-scc opened this issue Mar 31, 2025 · 0 comments

Comments

@will-scc
Copy link

Prerequisites

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

GitVersion package

AzureDevops task

GitVersion version

5.12.0

Operating system

Windows

What are you seeing?

I have an Azure DevOps pipeline that does the following steps:

steps:
- checkout: self
  fetchDepth: 0

- task: gitversion/setup@3
  displayName: 'setup GitVersion'
  inputs:
    versionSpec: 5.x

- task: gitversion/execute@3
  displayName: 'execute GitVersion'
  inputs:
    updateAssemblyInfo: true

It fails on execute GitVersion with the following:

Starting: execute GitVersion
==============================================================================
Task         : Execute GitVersion Task
Description  : Easy Semantic Versioning (https://semver.org/) for projects using Git
Version      : 3.1.11
Author       : GitTools Contributors
Help         : See the [documentation](https://gitversion.net/docs/) for help
==============================================================================
Running on: 'Azure Pipelines'
Disable Telemetry
Command: git -C D:/BuildAgents/_work/105/s rev-parse --is-shallow-repository
Command: D:\AgentTools\GitVersion.Tool\5.12.0\dotnet-gitversion.exe --roll-forward Major D:/BuildAgents/_work/105/s /output json /l console /updateassemblyinfo
##[error]GitVersion output is not valid JSON
dotnet-gitversion Output:
-------------------
undefined
-------------------
undefined
Finishing: execute GitVersion

I have tried with a custom GitVersion.yml config file that I know is valid as works on another project with the same result, so I'm using the default config for testing.

What is expected?

It should not error out with invalid JSON error.

Steps to Reproduce

  • Create new pipeline in Azure DevOps
  • Add GitTools extensions
  • Add gitversion/setup step
  • Add gitversion/execute step
  • Run pipeline

RepositoryFixture Test

No response

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

Starting: setup GitVersion
==============================================================================
Task         : Setup GitVersion Task
Description  : Easy Semantic Versioning (https://semver.org) for projects using Git
Version      : 3.1.11
Author       : GitTools Contributors
Help         : See the [documentation](https://gitversion.net/docs/) for help
==============================================================================
Running on: 'Azure Pipelines'
Disable Telemetry
--------------------------
Acquiring GitVersion.Tool for version spec: 5.x
--------------------------
Querying tool versions for [email protected] 
Found matching version: 5.12.0
Looking for local tool [email protected]
Found tool [email protected] at D:\AgentTools\GitVersion.Tool\5.12.0
--------------------------
GitVersion.Tool version: 5.12.0 found in local cache at D:\AgentTools\GitVersion.Tool\5.12.0.
--------------------------
Prepending D:\AgentTools\GitVersion.Tool\5.12.0 to PATH
Updated PATH: D:\AgentTools\GitVersion.Tool\5.12.0;
Set GITVERSION_PATH to D:\AgentTools\GitVersion.Tool\5.12.0
dotnet-gitversion installed successfully
dotnet-gitversion Output:
-------------------
undefined
-------------------
GitVersion setup successfully
Finishing: setup GitVersion
----------------------------------------------------

Starting: execute GitVersion
==============================================================================
Task         : Execute GitVersion Task
Description  : Easy Semantic Versioning (https://semver.org) for projects using Git
Version      : 3.1.11
Author       : GitTools Contributors
Help         : See the [documentation](https://gitversion.net/docs/) for help
==============================================================================
Running on: 'Azure Pipelines'
Disable Telemetry
Command: git -C D:/BuildAgents/_work/105/s rev-parse --is-shallow-repository
Command: D:\AgentTools\GitVersion.Tool\5.12.0\dotnet-gitversion.exe --roll-forward Major D:/BuildAgents//_work/105/s /output json /l console /updateassemblyinfo
##[error]GitVersion output is not valid JSON
dotnet-gitversion Output:
-------------------
undefined
-------------------
undefined
Finishing: execute GitVersion
@arturcic arturcic transferred this issue from GitTools/GitVersion Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant