Skip to content

Commit c603052

Browse files
committed
Replace [^a-zA-Z0-9-] with - in BranchName variable. Otherwise the branch name variable can never be used in any SemVer spec since it can contain a / when using nested branches.
1 parent 5d6ed2a commit c603052

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/GitVersionCore/SemanticVersioning/SemanticVersionFormatValues.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public SemanticVersionFormatValues(SemanticVersion semver, EffectiveConfiguratio
5151

5252
public string FullSemVer => semver.ToString("f");
5353

54-
public string BranchName => semver.BuildMetaData.Branch;
54+
public string BranchName => semver.BuildMetaData.Branch.RegexReplace("[^a-zA-Z0-9-]", "-");
5555

5656
public string Sha => semver.BuildMetaData.Sha;
5757

0 commit comments

Comments
 (0)