actions / labeler

An action for automatically labelling pull requests
MIT License
1.99k stars 419 forks source link

Use REST API to create labels if they don't exist yet #807

Open xander-marjoram opened 1 month ago

xander-marjoram commented 1 month ago

Description: Add a configuration option which would allow the action to attempt to create new labels if they do not already exist.

Justification: We have a generator which creates new components inside a monorepo. We use this labeler action to apply labels to pull requests based on which components are included in the pull request.

Currently, the majority of steps in our process are automated (including adding a new entry to our label YML file), however we still need to go to the labels page in the UI to create a new label before it can actually be added to PRs.

It's possible to use the REST API to do this separately, but I wondered whether this functionality might be well-suited as part of this action because it already has the logic to read the configuration and know which labels exist or not.

Are you willing to submit a PR? Maybe, but I don't know if this idea would be accepted or rejected in principle first.

mahabaleshwars commented 1 month ago

Hi @xander-marjoram, Thank you for creating this issue. We will investigate it and provide feedback as soon as we have some updates.