autolabeler needs on option to stop labeling on match (break on match)
See original GitHub issueI observed that is almost impossible to prevent multiple label matches, regardless how well you try to define the matching patterns. This does not play well with labels that are supposed to be exclusive, like being a bug or a feature or something to be excluded from the changelog.
Lucky for us the current configuration format is using sequence of objects for labeling, making it very easy to implement a break on match option for labels.
Basically by adding an option that tells labeler to stop finding other labels to add to the pull request when current pattern is matched we can prevent duplicates.
Using this we can put all labels that do not have conflicts at the top of the sequence and after them start adding labels with stop_on_match: true at the bottom.
Issue Analytics
- State:
 - Created 2 years ago
 - Comments:7 (7 by maintainers)
 

Top Related StackOverflow Question
LOL, I did not want to close it.
I cannot remove the update event because i will lose the ability to detect when two conflicting labels are present. Like having
bugandskip-changelogat the same time. Yes, I use a single workflow for all checks. See https://github.com/ansible-community/ansible-lint/blob/main/.github/workflows/ack.yml and https://github.com/ansible-community/devtools/blob/main/.github/workflows/ack.ymlPS. Not really a big deal but I wanted to mention it so you would eventually know what features is better to implement, or not.