Skip to content

Commit 0fd23d1

Browse files
authored
Merge pull request #4135 from vinnyrose/feature/underscore-label-fix
Replace underscores in branch specific labels
2 parents 4edaa30 + 46b0027 commit 0fd23d1

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/GitVersion.Core.Tests/IntegrationTests/FeatureBranchScenarios.cs

+1
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ public void CanUseBranchNameOffAReleaseBranch()
185185
[TestCase("alpha", "JIRA-123", "^features?[/-](?<BranchName>.+)", "alpha")]
186186
[TestCase($"alpha.{ConfigurationConstants.BranchNamePlaceholder}", "JIRA-123", "^features?[/-](?<BranchName>.+)", "alpha.JIRA-123")]
187187
[TestCase("{BranchName}-of-task-number-{TaskNumber}", "4711_this-is-a-feature", "^features?[/-](?<TaskNumber>\\d+)_(?<BranchName>.+)", "this-is-a-feature-of-task-number-4711")]
188+
[TestCase("{BranchName}", "4711_this-is-a-feature", "^features?[/-](?<BranchName>.+)", "4711-this-is-a-feature")]
188189
public void ShouldUseConfiguredLabel(string label, string featureName, string regularExpression, string preReleaseLabelName)
189190
{
190191
var configuration = GitFlowConfigurationBuilder.New

src/GitVersion.Core/Extensions/ConfigurationExtensions.cs

+2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ public static bool IsReleaseBranch(this IGitVersionConfiguration configuration,
103103
{
104104
label = label.Replace("{" + groupName + "}", match.Groups[groupName].Value);
105105
}
106+
107+
label = label.Replace('_', '-');
106108
}
107109
}
108110

0 commit comments

Comments
 (0)