Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-11-12 21:12:20 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-11-12 21:12:20 +0300
commit60aef5496ecea447e860786fe391eb45d2cf61e5 (patch)
treea20fdcc01a8d384e8b6d9c9cc6f58ad3177070d7 /Dangerfile
parent76cbe9e688549d47b0055573380b908cf9a72ed1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'Dangerfile')
-rw-r--r--Dangerfile9
1 files changed, 8 insertions, 1 deletions
diff --git a/Dangerfile b/Dangerfile
index ab96c43c4e5..212097f6a68 100644
--- a/Dangerfile
+++ b/Dangerfile
@@ -19,10 +19,17 @@ anything_to_post = status_report.values.any? { |data| data.any? }
return unless helper.ci?
-if project_helper.labels_to_add.any?
+def post_labels
gitlab.api.update_merge_request(gitlab.mr_json['project_id'],
gitlab.mr_json['iid'],
add_labels: project_helper.labels_to_add.join(','))
+rescue Gitlab::Error::Forbidden
+ labels = project_helper.labels_to_add.map { |label| %Q(~"#{label}") }
+ warn("This Merge Request needs to be labelled with #{labels.join(' ')}. Please request a reviewer or maintainer to add them.")
+end
+
+if project_helper.labels_to_add.any?
+ post_labels
end
if anything_to_post