[Feature] Allow named captures in regex to be used in tag names
See original GitHub issueIs your feature request related to a problem? Please describe.
I’m managing a product and I want to be able to release explicit alpha
, beta
and rc
builds depending on the branch name. Right now I have to create multiple branch configs with regex’s to match the branch suffixes, but I thought it could be cool if GitVersion was able to do named captures and then allow those names to be used in the tag format, similar to how you have {BranchName}
currently.
Detailed Description
How this could look is in a branch config, you could have something like
branches:
release:
regex: ^releases?[/-].*?(-(?<regexsuffix>.*))?$
tag: {regexsuffix || 'rc'}
So in this example, it attempts to match a suffix on the branch name such as -alpha$
or -beta$
and then exposes that as a regexsuffix
variable in the tag format. An extra step in the tag format I’ve envisioned here is to be able to support a fallback, so if there is no named group capture, then fallback to the string value rc
.
Context
This would ultimately allow for dynamic configuration of a branch’s tag so that you wouldn’t always need multiple configurations if they are ultimately the same apart from the regex / tag config.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
I would rename the
tests
intointegration
in the root, and create asrc\tests
and move there the tests projects, but keep them in the main solution@asbjornu cool, I think that’s something I should be able to do 👍.
Do you have an example of how you need the tests written. The
tests
folder is a little empty so can’t fully work out how you are doing them.