Skip to content

Commit

Permalink
Merge pull request #4135 from vinnyrose/feature/underscore-label-fix
Browse files Browse the repository at this point in the history
Replace underscores in branch specific labels
  • Loading branch information
arturcic authored Jul 31, 2024
2 parents 4edaa30 + 46b0027 commit 0fd23d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ public void CanUseBranchNameOffAReleaseBranch()
[TestCase("alpha", "JIRA-123", "^features?[/-](?<BranchName>.+)", "alpha")]
[TestCase($"alpha.{ConfigurationConstants.BranchNamePlaceholder}", "JIRA-123", "^features?[/-](?<BranchName>.+)", "alpha.JIRA-123")]
[TestCase("{BranchName}-of-task-number-{TaskNumber}", "4711_this-is-a-feature", "^features?[/-](?<TaskNumber>\\d+)_(?<BranchName>.+)", "this-is-a-feature-of-task-number-4711")]
[TestCase("{BranchName}", "4711_this-is-a-feature", "^features?[/-](?<BranchName>.+)", "4711-this-is-a-feature")]
public void ShouldUseConfiguredLabel(string label, string featureName, string regularExpression, string preReleaseLabelName)
{
var configuration = GitFlowConfigurationBuilder.New
Expand Down
2 changes: 2 additions & 0 deletions src/GitVersion.Core/Extensions/ConfigurationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ public static bool IsReleaseBranch(this IGitVersionConfiguration configuration,
{
label = label.Replace("{" + groupName + "}", match.Groups[groupName].Value);
}

label = label.Replace('_', '-');
}
}

Expand Down

0 comments on commit 0fd23d1

Please sign in to comment.