[WIP] Expose BaseSemVer as Output Variable #4804
Draft
+256
−29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


This PR adds
BaseSemVerto the standard output variables exposed by GitVersion.Description
This PR adds
BaseSemVerto the standard output variables exposed by GitVersion, making it available alongside existing version fields in:GitVersion_BaseSemVer)The
BaseSemVerrepresents the base semantic version calculated by GitVersion before any pre-release tags or metadata are applied. This is the foundational version derived from the repository's version tags and configuration.Related Issue
This PR addresses a feature request for exposing BaseSemVer in output variables.
Resolves #4803
Motivation and Context
The Problem
While GitVersion internally calculates
BaseSemVeras a fundamental part of its versioning logic, this value is not currently exposed in the standard output variables. Teams that need access to the base version must either:Why BaseSemVer Matters
The base semantic version is particularly valuable for:
Incremental Analysis Tools: Systems like SonarCloud require the previous/base version to generate accurate incremental code coverage reports and quality gate comparisons.
Release Comparisons: CI/CD pipelines that need to compare the current build against a baseline version for:
Documentation & Reporting: Generating release notes or reports that reference the underlying semantic version without pre-release suffixes.
Multi-stage Pipelines: Different pipeline stages may need the base version separately from the full semantic version with metadata.
Why This Change is Valuable
By exposing
BaseSemVeras a standard output variable, we:How Has This Been Tested?
Unit Tests: Added/updated tests to verify:
Verification Steps
Screenshots (if appropriate):
Example JSON output showing the new
BaseSemVerfield:{ "Major": 5, "Minor": 12, "Patch": 0, "BaseSemVer": "5.12.0", "SemVer": "5.12.0-beta.1", "FullSemVer": "5.12.0-beta.1+42", ... }Additional Notes
This change is purely additive - it introduces a new output variable without modifying any existing behavior or outputs. The risk of regression is minimal, and it opens up new integration possibilities for teams using GitVersion in their CI/CD pipelines.
Checklist: