diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-03 18:10:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-03 18:10:36 +0300 |
commit | 78aaabb87f180e93fa53aba407a0eef1e12a7a56 (patch) | |
tree | 6072c319e481f75960853c557578a5d04315b1fe /Dangerfile | |
parent | 5f0d27d131aced1a53e8cbc7db023d9f947f8a1a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'Dangerfile')
-rw-r--r-- | Dangerfile | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Dangerfile b/Dangerfile index 212097f6a68..ca729f1b941 100644 --- a/Dangerfile +++ b/Dangerfile @@ -2,14 +2,24 @@ require 'gitlab-dangerfiles' -gitlab_dangerfiles = Gitlab::Dangerfiles::Engine.new(self) -gitlab_dangerfiles.import_plugins +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 -return if helper.release_automation? +project_name = ee? ? 'gitlab' : 'gitlab-foss' -danger.import_plugin('danger/plugins/*.rb') +Gitlab::Dangerfiles.for_project(self, project_name) do |gitlab_dangerfiles| + gitlab_dangerfiles.import_plugins -gitlab_dangerfiles.import_dangerfiles + 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)) |