From 9c28b22cfc7b2b9306b9c72d53f5c88c3129eb67 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 29 Mar 2022 15:09:53 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- danger/z_metadata/Dangerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'danger') diff --git a/danger/z_metadata/Dangerfile b/danger/z_metadata/Dangerfile index 8aeb0c33a9c..9140bb7d988 100644 --- a/danger/z_metadata/Dangerfile +++ b/danger/z_metadata/Dangerfile @@ -2,7 +2,7 @@ # rubocop:disable Style/SignalException -DEFAULT_BRANCH = 'master' +default_branch = ENV['CI_DEFAULT_BRANCH'] || 'main' if gitlab.mr_body.size < 5 fail "Please provide a proper merge request description." @@ -14,12 +14,12 @@ end has_milestone = !gitlab.mr_json["milestone"].nil? -unless has_milestone || (helper.security_mr? && helper.mr_target_branch == DEFAULT_BRANCH) +unless has_milestone || (helper.security_mr? && helper.mr_target_branch == default_branch) warn "This merge request does not refer to an existing milestone.", sticky: false end has_pick_into_stable_label = helper.mr_labels.find { |label| label.start_with?('Pick into') } -if helper.mr_target_branch != DEFAULT_BRANCH && !has_pick_into_stable_label && !helper.security_mr? - warn "Most of the time, merge requests should target `#{DEFAULT_BRANCH}`. Otherwise, please set the relevant `Pick into X.Y` label." +if helper.mr_target_branch != default_branch && !has_pick_into_stable_label && !helper.security_mr? + warn "Most of the time, merge requests should target `#{default_branch}`. Otherwise, please set the relevant `Pick into X.Y` label." end -- cgit v1.2.1