diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-12 18:12:20 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-12 18:12:20 +0000 |
commit | 60aef5496ecea447e860786fe391eb45d2cf61e5 (patch) | |
tree | a20fdcc01a8d384e8b6d9c9cc6f58ad3177070d7 /Dangerfile | |
parent | 76cbe9e688549d47b0055573380b908cf9a72ed1 (diff) | |
download | gitlab-ce-60aef5496ecea447e860786fe391eb45d2cf61e5.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'Dangerfile')
-rw-r--r-- | Dangerfile | 9 |
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 |