-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add support for a custom tag prefix #8
Conversation
This branch adds support for specifiying a tag prefix before the version number. It turns out that this was actually pretty simple to add. We simply interpolate the passed-in prefix to the regular expression for detecting tags, and then strip the prefix when generating the version number. Currently, the prefix is interpreted as a fixed string; if it contains regular expression characters, we escape them before adding it to the pattern that's matched to detect tags that should generate releases. It's possible that maybe we'd actually _prefer_ to allow interpreting it as a pattern, so I'd be happy to change that if so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
It's possible that maybe we'd actually prefer to allow interpreting it
as a pattern, so I'd be happy to change that if so.
I was originally thinking of a use case where tags exist for each crate, such as crossbeam, so I think eventually supporting regular expressions might be preferable.
However, in such a use case, there is a changelog for each crate, so supporting regular expressions in the tag prefix is likely to be insufficient.
So, I don't believe that regular expression support will block this PR.
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
That was also what I was imagining, actually --- my goal was to be able to use the action for the It would be even nicer if this action could handle extracting the crate name based on a regex prefix, but that would be a bit more work, I think...we'd then also need a way to express that a variable (the prefix) should be interpolated into the changelog path, the way we currently do for release titles. |
After thinking about it a bit more, we should probably just make |
Sounds good to me. |
Also, allow interpolating the prefix (as well as version and tag) into the changelog path. This way, we can easily support multi-crate workspaces and other repositories with multiple changelog files. Signed-off-by: Eliza Weisman <[email protected]>
Okay, the prefix is now matched as a pattern, and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Taiki Endo <[email protected]>
I've replaced the use of |
Published in 1.3.0. |
This branch adds support for specifiying a tag prefix before the version
number. The prefix is specified as a bash regular expression; the string
matching that regular expression is available in the
$prefix
variablethat can be interpolated into the
changelog
path andtitle
string.Additionally, since I was adding support for interpolating
$prefix
into the changelog path anyway, I went ahead and allowed
$version
and$tag
to be interpolated into the changelog path as well. This mightbe useful in cases where the changelog for each version is stored in its
own text file...though I don't think this is a particularly common
pattern.
Closes #1