Skip to content
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

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

Open
2 tasks done
Sam-Tymoshchuk opened this issue Jan 9, 2025 · 0 comments

Comments

@Sam-Tymoshchuk
Copy link

Sam-Tymoshchuk commented Jan 9, 2025

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/[email protected] 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
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