You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My team has a need for dynamic labels based on the branch names in the PR.
Specifically, if we are merging into a branch marked release/XXX (such as release/1.0) then we apply the tag XXX (so release/1.0 would get the tag 1.0).
To facilitate this I have added a feature to my fork of this library that is completely backwards compatible, but allows specifying regular expressions with groups, and labels based off those groups.
For example in my use case above, you could create a config like so:
$1:
baseRegExp: 'release[/](.*)'
This would then attempt to match the base branch of a PR with the above regular expression. If it matches it would apply the first matched group ($1) as the label. So release/1.0 would return 1.0 as the label as needed above.
Here's the release version with the change in it (including unit tests).
If you feel like this would be of benefit to merge into your library, please let me know and I'll create a PR. I also recognize that this may be a little too specific or complex for the goal of this library. Either way is fine with me.
The text was updated successfully, but these errors were encountered:
My team has a need for dynamic labels based on the branch names in the PR.
Specifically, if we are merging into a branch marked
release/XXX
(such asrelease/1.0
) then we apply the tag XXX (sorelease/1.0
would get the tag1.0
).To facilitate this I have added a feature to my fork of this library that is completely backwards compatible, but allows specifying regular expressions with groups, and labels based off those groups.
For example in my use case above, you could create a config like so:
This would then attempt to match the base branch of a PR with the above regular expression. If it matches it would apply the first matched group (
$1
) as the label. Sorelease/1.0
would return1.0
as the label as needed above.Here's the release version with the change in it (including unit tests).
https://github.com/TheCleric/pr-branch-labeler/tree/v3.1
If you feel like this would be of benefit to merge into your library, please let me know and I'll create a PR. I also recognize that this may be a little too specific or complex for the goal of this library. Either way is fine with me.
The text was updated successfully, but these errors were encountered: