2019-04-24 12:08:33 +00:00
|
|
|
# frozen_string_literal: true
|
2019-09-06 11:21:53 +00:00
|
|
|
|
2021-03-12 12:09:33 +00:00
|
|
|
require 'gitlab-dangerfiles'
|
2019-09-06 11:21:53 +00:00
|
|
|
|
2021-05-05 12:10:33 +00:00
|
|
|
gitlab_dangerfiles = Gitlab::Dangerfiles::Engine.new(self)
|
|
|
|
gitlab_dangerfiles.import_plugins
|
2021-05-03 18:10:17 +00:00
|
|
|
|
2021-05-04 09:09:59 +00:00
|
|
|
return if helper.release_automation?
|
2021-05-03 18:10:17 +00:00
|
|
|
|
2021-05-05 12:10:33 +00:00
|
|
|
danger.import_plugin('danger/plugins/*.rb')
|
|
|
|
|
|
|
|
gitlab_dangerfiles.import_dangerfiles
|
|
|
|
|
2021-03-12 12:09:33 +00:00
|
|
|
project_helper.rule_names.each do |rule|
|
|
|
|
danger.import_dangerfile(path: File.join('danger', rule))
|
2019-04-04 11:26:01 +00:00
|
|
|
end
|
2020-05-25 12:08:23 +00:00
|
|
|
|
2020-05-26 12:08:22 +00:00
|
|
|
anything_to_post = status_report.values.any? { |data| data.any? }
|
|
|
|
|
2021-03-12 12:09:33 +00:00
|
|
|
if helper.ci? && anything_to_post
|
2020-05-26 12:08:22 +00:00
|
|
|
markdown("**If needed, you can retry the [`danger-review` job](#{ENV['CI_JOB_URL']}) that generated this comment.**")
|
|
|
|
end
|