debian-mirror-gitlab/danger/z_metadata/Dangerfile

20 lines
641 B
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
2018-11-18 11:00:15 +05:30
# rubocop:disable Style/SignalException
2022-06-21 17:19:12 +05:30
default_branch = ENV['CI_DEFAULT_BRANCH'] || 'main'
2021-11-11 11:23:49 +05:30
2018-11-18 11:00:15 +05:30
if gitlab.mr_body.size < 5
fail "Please provide a proper merge request description."
end
unless gitlab.mr_json["assignee"]
warn "This merge request does not have any assignee yet. Setting an assignee clarifies who needs to take action on the merge request at any given time."
end
has_milestone = !gitlab.mr_json["milestone"].nil?
2022-06-21 17:19:12 +05:30
unless has_milestone || (helper.security_mr? && helper.mr_target_branch == default_branch)
2018-11-18 11:00:15 +05:30
warn "This merge request does not refer to an existing milestone.", sticky: false
end