labeler icon indicating copy to clipboard operation
labeler copied to clipboard

Support for labeling based on PR title

Open rzvxa opened this issue 1 year ago • 7 comments

Description: It would be nice if we could use this action to set up a step that would label PRs based on their title. Take feat(xxx): something and fix(yyy): something else as examples. We can write a configuration like this:

T-feat:
  - pr-title: "^feat"

T-fix:
 - pr-title: "^fix"

And get respective labels on PRs based on their titles.

Justification: Allows automation for workflows that have PR naming conventions and we already have something similar with the branch names, So if there isn't an API restriction making it impossible it can be a useful addition.

Are you willing to submit a PR? Yes

rzvxa avatar Oct 05 '24 12:10 rzvxa

Hello @rzvxa, Thank you for creating this feature request. We will investigate it and get back to you as soon as we have some feedback.

gowridurgad avatar Oct 07 '24 08:10 gowridurgad

Hello @rzvxa, Thank you for creating this feature request. We will investigate it and get back to you as soon as we have some feedback.

Thanks, I appreciate your time❤️

rzvxa avatar Oct 07 '24 09:10 rzvxa

This would be very beneficial; please consider implementing it. Thank you in advance!

iamironz avatar Oct 28 '24 16:10 iamironz

For our case we would also find this very useful for applying a "DO-NOT-MERGE" label to a PR when they have "do not merge" in the title

benfielden-onx avatar Dec 11 '24 15:12 benfielden-onx

This would be a huge benefit for our use case as well. We don't enforce anything on individual branches, only on the actual merge where we squash and use the PR title and description.

So our branch names aren't curated, but our PR titles are. Which unfortunately falls outside of the current action configuration.

HaydenReeve avatar May 16 '25 06:05 HaydenReeve

Tracking this with the good work done in #866.

shadoath avatar May 31 '25 13:05 shadoath

Big +1 to this feature request. It would be great to get rid of my custom solution:

  1. Take the all-labels output from this action
  2. Use gh pr view to get the PR title (dynamic value whereas github.event.pull_request.title is statically set per workflow trigger)
  3. Use gh pr edit to add/remove labels (if applicable) after analyzing the title.

2bndy5 avatar Sep 10 '25 00:09 2bndy5