Skip to content

Support for labeling based on PR title #809

Open

Description

@rzvxa

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

Activity

  1. added
    feature request
    on Oct 5, 2024
  2. v-gowridurgad commented on Oct 7, 2024

    @v-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.

  3. rzvxa commented on Oct 7, 2024

    @rzvxa
    Author

    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❤️

  4. iamironz commented on Oct 28, 2024

    @iamironz

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

  5. benfielden-onx commented on Dec 11, 2024

    @benfielden-onx

    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

  6. HaydenReeve commented on May 16, 2025

    @HaydenReeve

    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.

  7. shadoath commented on May 31, 2025

    @shadoath

    Tracking this with the good work done in #866.

  8. 2bndy5 commented on Sep 10, 2025

    @2bndy5

    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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions