diff options
Diffstat (limited to 'danger/product_intelligence/Dangerfile')
-rw-r--r-- | danger/product_intelligence/Dangerfile | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/danger/product_intelligence/Dangerfile b/danger/product_intelligence/Dangerfile index d2bed7629ff..8019fad57db 100644 --- a/danger/product_intelligence/Dangerfile +++ b/danger/product_intelligence/Dangerfile @@ -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 |