Commit fb0b7242 authored by Mikolaj Wawrzyniak's avatar Mikolaj Wawrzyniak Committed by Albert Salim

Fix lable applying logic for PI dangerbot

parent f921f8a5
......@@ -86,8 +86,13 @@ if matching_changed_files.any?
fail format(UPDATE_DICTIONARY_MESSAGE) if required_dictionary_update_changed_files.any? && dictionary_changed_file.empty?
labels = ['product intelligence']
labels << 'product intelligence::review pending' unless helper.mr_has_labels?('product intelligence::approved')
markdown(helper.prepare_labels_for_mr(labels))
labels = []
labels << 'product intelligence' unless helper.mr_has_labels?('product intelligence')
labels << 'product intelligence::review pending' unless helper.mr_has_labels?(['product intelligence::approved', 'product intelligence::review pending'])
if labels.any?
gitlab.api.update_merge_request(gitlab.mr_json['project_id'],
gitlab.mr_json['iid'],
add_labels: helper.prepare_labels_for_mr(labels))
end
end
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