-
Notifications
You must be signed in to change notification settings - Fork 652
[BUG]: branch regex is matched against {EscapedBranchName} not {BranchName} #4154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Has as PR been made for this? I wasn't able to find one and I am running into a similar issue where my regex is:
and I am winding up with the output containing {BranchName} as well:
|
@Oninaig - I have a variant of the following. Does this work for you? I do not think a PR has been made yet. feature:
regex: ^features?[/-](?<BranchName>.+)$ Hope that helps (or that you already arrived at something similar). |
🎉 This issue has been resolved in version 6.2.0 🎉 Your GitReleaseManager bot 📦🚀 |
Prerequisites
GitVersion package
GitVersion.Tool
GitVersion version
6.0.1
Operating system
Windows
What are you seeing?
It took me a lot of experimentation to understand why I was getting the text "{BranchName}" in my GitVersion output ... and more confusingly: "--BranchName-" in my informational version numbers ...
It turns out that even though all the default configuration uses
[/-]
in the regex patterns, the actual value that theregex
configuration is being matched against is the {EscapedBranchName} not the {BranchName} (so the / will never match).What is expected?
I expected the regex to be matched against the branch name, with slashes in it (so I can use dashes WITHIN the path segments without breaking the regex matching). That is, we need to be able to use a branch name like
feature/jaykul/new-terminal
and have the {BranchName} come out as "new-terminal" not "terminal"Additionally, I think the documentation needs to call out when variable output is being set by the
regex
patterns. This was not clear to me until I got the wrong output and started investigating -- the old behavior (5.x) allowed me to override the regex without needing to re-define the capture group.Steps to Reproduce
Create branches config:
Create a branch named:
/feature/yourname/dash-separated-words
Run gitversion, and see {BranchName} everywhere.
RepositoryFixture Test
No response
Output log or link to your CI build (if appropriate).
No response
The text was updated successfully, but these errors were encountered: