Skip to content

[ISSUE]: Allow customization of version variable set in $(Build.BuildNumber) for Azure DevOps GitVersion task #1434

@Sam-Tymoshchuk

Description

@Sam-Tymoshchuk

Prerequisites

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

GitVersion package

AzureDevops task

What are you seeing?

Azure DevOps task: gitversion/execute@3.1.1 always overrides $(Build.BuildNumber) with the FullSemVer value.

The problem with this behavior is that FullSemVer appends a suffix (e.g., +88) to the version, which is incompatible with tools like docker build that require a clean version format. This limits the usability of the version number in such scenarios.

Using overrideConfig does not change anything.

inputs:
    overrideConfig: |
        update-build-number=false

What is expected?

It would be ideal to have the ability to choose which Version Variables from GitVersion are set into $(Build.BuildNumber). For example, allowing the use of SemVer instead of FullSemVer would produce a cleaner version number (1.2.3 instead of 1.2.3+88), which is more compatible with tools like docker build.

Steps to Reproduce

Probably this one should be parametrized:
https://github.com/GitTools/actions/blob/main/src/tools/gitversion/tool.ts#L73

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

The build from a branch got next logs

GitVersion executed successfully
Async Command Start: Update Build Number
Update build number to 1.2.1-feature-23653-kpis-on-demand.1+17 for build 90059
Async Command End: Update Build Number
Finishing: Determine Semantic Version

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy