Strip the version prefix when using `--tag-pattern` in monorepo context
Is there an existing issue or pull request for this?
- [x] I have searched the existing issues and pull requests
Feature description
Currently in a monorepo the tag could be something foo-1.0.0 and the version field in the context reports that without modification. This is not the version though, it's the project and version marshaled.
Desired solution
the version should be 1.0.0. the tag should be foo-1.0.0
Alternatives considered
If we can't break compat (but I would hope we could) then somewhere in the context 1.0.0 should be made available.
Additional context
No response
I was able to work around this in the template doing,
{{ version | split(pat="-") | last }}
Does that mean we need to derive the monorepo name from the current directory and remove it from the version? Is there another way?
Each project has a different versioning scheme and this seems overly specific tbh - I'd rather the user to configure it like you did in the template :)
Sure, when providing --tag-pattern="foo-", take the latest tag and simply remove the version number it would otherwise bump with --bump. The rest of it is the "project name."
Tag pattern is a regex though so I'm not sure a plain string-replace would work in all the cases. We could do a regex-replace instead but yeah, it won't be pretty 🫠