labeler
labeler copied to clipboard
Assigns labels based on branch names
Assign a label based on the branch name! (Closes #186)
Depending on your branch name you may want to apply different labels based on the purpose of the branch.
eg. say that you wanted to something like:
feature:
- branch: feature/*
bug:
- branch: */bug/*
It would apply the feature
label to the branch to feature/add-the-new-thing
branch, and the bug
label to the josh/bug/fix-the-new-thing
branch.
You can also provide a list of arguments in the config
release:
- branch: ['release/*', 'hotfix/**']
FYI: I found that this wasn't working for me as expected. I got it working for me in https://github.com/joshdales/labeler/pull/1. I didn't spend much time writing up any context, partly because this PR doesn't have any response, so I'm not sure if anyone is planning to take the time to review this. I'd be happy to communicate more about it if there's interest.
EDIT: Updated PR reference.
@amiel If it's not working properly I'm still interested so would appreciate any information you can give 😄
Hi @joshdales. I just realized that I referenced the wrong pull request in my last comment. I've edited it to reference the one I meant to reference: https://github.com/joshdales/labeler/pull/1.
The problem I ran in to was that github.context.ref
was producing something like refs/pull/23/head
, which would not match my branch names like feature/foo
.
Using github.context.payload.pull_request.head.ref
resolves this for me and uses the branch name that I actually want to match on. I don't have a lot of experience with github actions, but I found this object path here: https://github.com/TimonVS/pr-labeler-action/blob/master/src/action.ts#L25.
I also considered updating your changes to support a list of branch patterns, just like the way lists of files are supported. However, I got it working by using the glob matching and I added a test to demonstrate that. This took me a little while to figure out because the minimatch documentation shows an example with (bar|foo)
, but I needed to use the glob syntax ({bar,foo}
) instead.
@amiel took your suggestion and I've updated this PR to support a list of branch arguments as well 👍
@joshdales Awesome! I'll pull those changes upstream too since we are pinned to our branch until this gets actually released.
Be cool to get this feature shipped. I'd selfishly find it useful.
You should update the README.md file to documenting your feature.
Any updates on this?
Any chance we can get this merged soon?
Any updates @DennisBoanini @pje ?
Any updates @DennisBoanini @pje ?
I don't know, the owner of the PR is @joshdales, I only add a suggestion
I see that there is 1 pending reviewer and the branch have conflicts. Any change to merge this PR?
@DennisBoanini @arivera-xealth I tried to keep it updated and added to it for a while but it felt kinda fruitless after 5 months 😞
Happy to come back and make the suggestions and fix those conflicts once a code owner has looked at it
@joshdales review received. would love to see this being merged.
@franklinkim the review isn't from a code owner so it can't be merged 😢
😭
Guys, why this PR still cannot be merged?
@DennisBoanini I can't merge it without it being reviewed by a code owner first.
I've fixed the merge conflict though and added some notes to the readme to try and breathe some life back into this PR.
@pje Any chance that you or someone else on the actions team could take a look?
@pje 👇 Any chance that you or someone else on the actions team could take a look?
I wonder what's going on with this repo and the maintainers. This PR was opened more than a year ago and there's clearly a lot of interest in the feature, but not even one response from the maintainers. 😞
I wonder what's going on with this repo and the maintainers. This PR was opened more than a year ago and there's clearly a lot of interest in the feature, but not even one response from the maintainers. 😞
You're right, that's incredible. I don't understand why.
Who is the one that can accept this PR?
I wonder what's going on with this repo and the maintainers. This PR was opened more than a year ago and there's clearly a lot of interest in the feature, but not even one response from the maintainers. 😞
Also interested in this feature
@pje any chance you want to take this up in your project? It looks like a really nice addition I would definitely use
maybe @chrispat ?
Hi @joshdales. Thanks for maintaining this branch despite the lack of review from an actual code owner. I know it has been frustrating. I appreciate it as my team and I are still using this in daily builds.
Something happened with the most recent commit (0ad789c) and we're getting this error:
| /run/act/actions/joshdales-labeler@main/dist/index.js:14965
| util.inherits(TunnelingAgent, events.EventEmitter);
| ^
|
| TypeError: util.inherits is not a function
Also, it looks like my changes from joshdales#1 are not included anymore. I have hard-coded our action to use joshdales/labeler@6e276063fecb6573bf5dc89df1f4a1e317e3a6ce, which is still working for me.
Anyway, I just wanted to let you know that something doesn't seem right with that last merge. Thanks again.
@amiel Ahh damn - that'll teach me to merge late at night 😞.
Thanks for letting me know I'll take a look at this tonight or tomorrow and try and get it fixed 👍
Thanks @joshdales!
Okay I've got it working again! 🎉 https://github.com/joshdales/glowing-octo-disco/pull/1
Seems that I just needed to run the build command again