Skip to content

GitVersionTask fails when building from a tag #2301

@TrentScholl

Description

@TrentScholl

Describe the bug
I'm using GitHub actions to create a new build of a project that is using GitVersionTask.

When the build runs on a branch, everything works fine. When it runs for a tag, the following error is outputted.

/root/.nuget/packages/gitversiontask/5.3.5/build/GitVersionTask.targets(46,9): warning : 2020-05-31 05:47:23                WARN [05/31/20 5:47:23:62] Failed to inherit 
Increment branch configuration, no branches found. [/src/Core/Core.csproj]
/root/.nuget/packages/gitversiontask/5.3.5/build/GitVersionTask.targets(46,9): warning : Falling back to master branch config [/src/Core/Core.csproj]
/root/.nuget/packages/gitversiontask/5.3.5/build/GitVersionTask.targets(46,9): warning :  [/src/Core/Core.csproj]
/root/.nuget/packages/gitversiontask/5.3.5/build/GitVersionTask.targets(46,9): warning : It looks like the branch being examined is a detached Head pointing to commit '87436ac'. Without a proper branch name GitVersion cannot determine the build version. [/src/Core/Core.csproj]
/root/.nuget/packages/gitversiontask/5.3.5/build/GitVersionTask.targets(10,9): warning : 2020-05-31 05:47:24                WARN [05/31/20 5:47:24:60] Failed to inherit 
Increment branch configuration, no branches found. [/src/Core/Core.csproj]
/root/.nuget/packages/gitversiontask/5.3.5/build/GitVersionTask.targets(10,9): warning : Falling back to master branch config [/src/Core/Core.csproj]
/root/.nuget/packages/gitversiontask/5.3.5/build/GitVersionTask.targets(10,9): warning :  [/src/Core/Core.csproj]
/root/.nuget/packages/gitversiontask/5.3.5/build/GitVersionTask.targets(10,9): warning : It looks like the branch being examined is a detached Head pointing to commit '87436ac'. Without a proper branch name GitVersion cannot determine the build version. [/src/Core/Core.csproj]
/root/.nuget/packages/gitversiontask/5.3.5/build/GitVersionTask.targets(71,9): warning : 2020-05-31 05:47:24                WARN [05/31/20 5:47:24:68] Failed to inherit 
Increment branch configuration, no branches found. [/src/Core/Core.csproj]
/root/.nuget/packages/gitversiontask/5.3.5/build/GitVersionTask.targets(71,9): warning : Falling back to master branch config [/src/Core/Core.csproj]
/root/.nuget/packages/gitversiontask/5.3.5/build/GitVersionTask.targets(71,9): warning :  [/src/Core/Core.csproj]
/root/.nuget/packages/gitversiontask/5.3.5/build/GitVersionTask.targets(71,9): warning : It looks like the branch being examined is a detached Head pointing to commit '87436ac'. Without a proper branch name GitVersion cannot determine the build version. [/src/Core/Core.csproj]
/usr/share/dotnet/sdk/2.2.207/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.GenerateAssemblyInfo.targets(161,5): error MSB4044: The "GetAssemblyVersion" task was not given a value for the required parameter "NuGetVersion". [/src/Core/Core.csproj]
/usr/share/dotnet/sdk/2.2.207/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.GenerateAssem

GitVersion standalone works fine when checking out the tag.

Expected Behavior

The build completes with the correct version as per the tag

Actual Behavior

GitVersionTask fails with the above error

Steps to Reproduce

Run a build of a .NET Core 2.2 project in Docker using GitVersionTask 3.3.5

Context

Unable to complete build

Your Environment

GitVersionTask 5.3.5
Build running in a Docker container using mcr.microsoft.com/dotnet/core/sdk:2.2

GitVersion.yml

assembly-versioning-scheme: MajorMinorPatchTag
assembly-file-versioning-scheme: MajorMinorPatchTag
mode: ContinuousDeployment
continuous-delivery-fallback-tag: ""
branches:
  master:
    mode: ContinuousDeployment
    tag: "ci"
    increment: Minor
    track-merge-target: true
    tracks-release-branches: true
    is-release-branch: false
    prevent-increment-of-merged-branch-version: false
  release:
    regex: release?[/]
    mode: ContinuousDeployment
    increment: Patch
    is-release-branch: true
    prevent-increment-of-merged-branch-version: true
ignore:
  sha: []

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions