Commit 7b228d9f authored by Lin Jen-Shin's avatar Lin Jen-Shin

Only add labels in the list

Otherwise we'll be adding ~none
parent d08a9405
......@@ -14,8 +14,9 @@ SPECIALIZATIONS = {
}.freeze
labels_to_add = helper.changes_by_category.each_with_object([]) do |(category, _changes), memo|
label = SPECIALIZATIONS.fetch(category, category.to_s)
memo << label unless gitlab.mr_labels.include?(label)
label = SPECIALIZATIONS[category]
memo << label if label && !gitlab.mr_labels.include?(label)
end
if labels_to_add.any?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment