From a9ccf1ca269de350dd770eb722a0d7e24630837c Mon Sep 17 00:00:00 2001 From: smorokin <32683528+smorokin@users.noreply.github.com> Date: Fri, 28 Jul 2023 15:13:31 +0200 Subject: [PATCH] use regex to replace all invalid chars As suggested by @tobsil --- src/GitInfo/build/GitInfo.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitInfo/build/GitInfo.targets b/src/GitInfo/build/GitInfo.targets index fe0580d..7b6f33e 100644 --- a/src/GitInfo/build/GitInfo.targets +++ b/src/GitInfo/build/GitInfo.targets @@ -571,7 +571,7 @@ - $(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch)$(GitSemVerDashLabel)+$(GitBranch.Replace('/', '-').Replace('\', '-').Replace('_', '-').$(GitCommit) + $(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch)$(GitSemVerDashLabel)+$([System.Text.RegularExpressions.Regex]::Replace($(GitBranch), "[^0-9A-Za-z-]", "-")).$(GitCommit) $(Version)