Commit 96b6fe5a authored by Albert Salim's avatar Albert Salim

Merge branch 'mwaw/fix_product_intelligence_dangerfile' into 'master'

Fix lable applying logic for PI dangerbot

See merge request gitlab-org/gitlab!60135
parents 9fe3efd6 fb0b7242
...@@ -86,8 +86,13 @@ if matching_changed_files.any? ...@@ -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? fail format(UPDATE_DICTIONARY_MESSAGE) if required_dictionary_update_changed_files.any? && dictionary_changed_file.empty?
labels = ['product intelligence'] labels = []
labels << 'product intelligence::review pending' unless helper.mr_has_labels?('product intelligence::approved') 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'])
markdown(helper.prepare_labels_for_mr(labels))
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 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