diff --git a/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt b/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt index f141ccc585..f2943e4f82 100644 --- a/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt +++ b/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt @@ -1,7 +1,7 @@ assembly-versioning-scheme: MajorMinorPatch assembly-file-versioning-scheme: MajorMinorPatch mode: ContinuousDelivery -tag-prefix: '[vV]' +tag-prefix: '[vV]?' continuous-delivery-fallback-tag: ci major-version-bump-message: '\+semver:\s?(breaking|major)' minor-version-bump-message: '\+semver:\s?(feature|minor)' diff --git a/src/GitVersion.Core/Configuration/GitVersionConfiguration.cs b/src/GitVersion.Core/Configuration/GitVersionConfiguration.cs index 497a366258..3db85ce0f5 100644 --- a/src/GitVersion.Core/Configuration/GitVersionConfiguration.cs +++ b/src/GitVersion.Core/Configuration/GitVersionConfiguration.cs @@ -97,7 +97,7 @@ public override string ToString() return stringBuilder.ToString(); } - public const string DefaultTagPrefix = "[vV]"; + public const string DefaultTagPrefix = "[vV]?"; public const string ReleaseBranchRegex = "^releases?[/-]"; public const string FeatureBranchRegex = "^features?[/-]"; public const string PullRequestRegex = @"^(pull|pull\-requests|pr)[/-]"; diff --git a/src/GitVersion.Core/PublicAPI.Shipped.txt b/src/GitVersion.Core/PublicAPI.Shipped.txt index a05ee98e2e..c8b8b5622f 100644 --- a/src/GitVersion.Core/PublicAPI.Shipped.txt +++ b/src/GitVersion.Core/PublicAPI.Shipped.txt @@ -28,7 +28,7 @@ const GitVersion.BuildAgents.SpaceAutomation.EnvironmentVariableName = "JB_SPACE const GitVersion.BuildAgents.TeamCity.EnvironmentVariableName = "TEAMCITY_VERSION" -> string! const GitVersion.BuildAgents.TravisCi.EnvironmentVariableName = "TRAVIS" -> string! const GitVersion.Configuration.ConfigurationFileLocator.DefaultFileName = "GitVersion.yml" -> string! -const GitVersion.Configuration.GitVersionConfiguration.DefaultTagPrefix = "[vV]" -> string! +const GitVersion.Configuration.GitVersionConfiguration.DefaultTagPrefix = "[vV]?" -> string! const GitVersion.Configuration.GitVersionConfiguration.DevelopBranchKey = "develop" -> string! const GitVersion.Configuration.GitVersionConfiguration.DevelopBranchRegex = "^dev(elop)?(ment)?$" -> string! const GitVersion.Configuration.GitVersionConfiguration.FeatureBranchKey = "feature" -> string! diff --git a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersion.cs b/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersion.cs index 7918fe5e6d..3394a66e44 100644 --- a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersion.cs +++ b/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersion.cs @@ -143,7 +143,7 @@ public static SemanticVersion Parse(string version, string? tagPrefixRegex, Sema public static bool TryParse(string version, string? tagPrefixRegex, [NotNullWhen(true)] out SemanticVersion? semanticVersion, SemanticVersionFormat format = SemanticVersionFormat.Strict) { - var match = Regex.Match(version, $"^({tagPrefixRegex})?(?.*)$"); + var match = Regex.Match(version, $"^({tagPrefixRegex})(?.*)$"); if (!match.Success) {