Skip to content

GetVersion target does not update RepositoryBranch nor RepositoryCommit #1921

@dittodhole

Description

@dittodhole

This is an idea, to enhance stamping nuget packages created by sdk projects:
One could update the RepositoryBranch and RepositoryCommit msbuild properties accordingly in

<PropertyGroup Condition=" '$(UpdateVersionProperties)' == 'true' ">

My current workaround is as follows (somewhere in your .csproj-file):

<Target Name="UpdateRepositoryBranch" BeforeTargets="GenerateNuspec">
  <PropertyGroup>
    <RepositoryBranch>$(GitVersion_BranchName)</RepositoryBranch>
  </PropertyGroup>
</Target>
<Target Name="UpdateRepositoryCommit" BeforeTargets="GenerateNuspec">
  <PropertyGroup>
    <RepositoryCommit>$(GitVersion_Sha)</RepositoryCommit>
  </PropertyGroup>
</Target>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions