1 Star 1 Fork 1

Mars/gitlab

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dangerfile 1.51 KB
一键复制 编辑 原始数据 按行查看 历史
Rémy Coutable 提交于 2021-12-01 17:58 . Update gitlab-dangerfiles to 2.6.1
# frozen_string_literal: true
require 'gitlab-dangerfiles'
def ee?
# Support former project name for `dev` and support local Danger run
%w[gitlab gitlab-ee].include?(ENV['CI_PROJECT_NAME']) || Dir.exist?(File.expand_path('ee', __dir__))
end
project_name = ee? ? 'gitlab' : 'gitlab-foss'
Gitlab::Dangerfiles.for_project(self, project_name) do |gitlab_dangerfiles|
gitlab_dangerfiles.import_plugins
unless helper.release_automation?
danger.import_plugin('danger/plugins/*.rb')
gitlab_dangerfiles.import_dangerfiles(except: %w[simple_roulette])
gitlab_dangerfiles.config.files_to_category = ProjectHelper::CATEGORIES
end
end
return if helper.release_automation?
project_helper.rule_names.each do |rule|
danger.import_dangerfile(path: File.join('danger', rule))
end
anything_to_post = status_report.values.any? { |data| data.any? }
return unless helper.ci?
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
markdown("**If needed, you can retry the [`danger-review` job](#{ENV['CI_JOB_URL']}) that generated this comment.**")
end
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Ruby
1
https://gitee.com/mars167/gitlab.git
git@gitee.com:mars167/gitlab.git
mars167
gitlab
gitlab
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385