Skip to content

Commit 959e84a

Browse files
author
Simon Ejsing
committed
zero pad pull tag number
1 parent dadb5ea commit 959e84a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/GitVersionCore.Tests/VariableProviderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public void ProvidesVariablesInContinuousDeploymentModeWithTagNamePattern()
172172
var config = new TestEffectiveConfiguration(versioningMode: VersioningMode.ContinuousDeployment, tagNumberPattern: @"[/-](?<number>\d+)[-/]");
173173
var vars = VariableProvider.GetVariablesFor(semVer, config, false);
174174

175-
vars.FullSemVer.ShouldBe("1.2.3-PullRequest2.5");
175+
vars.FullSemVer.ShouldBe("1.2.3-PullRequest0002.5");
176176
}
177177

178178
[Test]

src/GitVersionCore/OutputVariables/VariableProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static VersionVariables GetVariablesFor(SemanticVersion semanticVersion,
2929
var numberGroup = match.Groups["number"];
3030
if (numberGroup.Success)
3131
{
32-
semanticVersion.PreReleaseTag.Name += numberGroup.Value;
32+
semanticVersion.PreReleaseTag.Name += numberGroup.Value.PadLeft(config.BuildMetaDataPadding, '0');
3333
}
3434
}
3535

0 commit comments

Comments
 (0)