Skip to content

[ISSUE]: GitHub Action fails parsing GitVersion variables file in v4.2 #1824

@pierluca

Description

@pierluca

Prerequisites

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

GitVersion package

GitHub Actions

What are you seeing?

The CI fails due to an error in parsing the GitVersion.yml file, with the following error (see below for full log output):

Command: /opt/hostedtoolcache/GitVersion.Tool/5.12.0/dotnet-gitversion --roll-forward Major /home/runner/work/CENSORED /output file /outputfile /home/runner/work/_temp/gitversion-046923e5-465e-4ee2-af7e-db92becd3c9e.json /l console /config /home/runner/work/CENSORED/eng/ci/GitVersion.yml
Error: Failed to read or parse GitVersion variables file: Unexpected token '', "{
  "Majo"... is not valid JSON

This broke suddenly, without changes on our parts, and corresponding to the release of v4.2

What is expected?

The CI to work, like it used to prior to v4.2 :-)

Steps to Reproduce

The CI:

      - name: Setup GitVersion
        uses: gittools/actions/gitversion/setup@v3
        with:
          versionSpec: ${{ env.GITVERSION_VERSION }}

      - name: Execute GitVersion
        id: gitversion
        uses: gittools/actions/gitversion/execute@v4
        with:
          configFilePath: ${{ env.GITVERSION_CONFIG }}

The env variables:

  GITVERSION_VERSION: "5.12"
  GITVERSION_CONFIG: ${{ github.workspace }}/eng/ci/GitVersion.yml

The GitVersion.yml file:

mode: ContinuousDeployment
assembly-versioning-scheme: MajorMinorPatch
branches:
  release:
    tag: rc
  pull-request:
    tag: pr
  hotfix:
    tag: fix
  develop:
    tag: beta
  feature:
    tag: useBranchName

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

Run gittools/actions/gitversion/execute@v4
  with:
    configFilePath: /home/runner/work/CENSORED/eng/ci/GitVersion.yml
    disableCache: false
    disableNormalization: false
    disableShallowCloneCheck: false
    updateAssemblyInfo: false
    updateProjectFiles: false
  env:
    DOTNET_VERSION: 9.0.x
    DOTNET_NOLOGO: true
    DOTNET_CLI_TELEMETRY_OPTOUT: true
    NUGET_VERSION: 5.x
    NUGET_PACKAGES: /home/runner/work/CENSORED/.nuget/packages
    NODE_VERSION: 20.x
    GITVERSION_VERSION: 5.12
    GITVERSION_CONFIG: /home/runner/work/CENSORED/eng/ci/GitVersion.yml
    MAKE_PARAMS: CI=true BackendBuildConfig=Release WebAppBuildConfig=prod Legacy=false
    DOTNET_ROOT: /usr/share/dotnet
    JAVA_HOME: /opt/hostedtoolcache/Java_Zulu_jdk/17.0.17-10/x64
    JAVA_HOME_17_X64: /opt/hostedtoolcache/Java_Zulu_jdk/17.0.17-10/x64
    GITVERSION_PATH: /opt/hostedtoolcache/GitVersion.Tool/5.12.0
Running on: 'GitHub Actions'
Disable Telemetry
Command: git -C /home/runner/work/CENSORED rev-parse --is-shallow-repository
Command: /opt/hostedtoolcache/GitVersion.Tool/5.12.0/dotnet-gitversion --roll-forward Major /home/runner/work/CENSORED /output file /outputfile /home/runner/work/_temp/gitversion-046923e5-465e-4ee2-af7e-db92becd3c9e.json /l console /config /home/runner/work/CENSORED/eng/ci/GitVersion.yml
Error: Failed to read or parse GitVersion variables file: Unexpected token '', "{
  "Majo"... is not valid JSON

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions