diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2019-09-06 14:21:53 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2019-09-06 14:21:53 +0300 |
commit | 9fc9ab2ba2b0db05f6365054aa3bddcda3c7333d (patch) | |
tree | d59a451e3300c4598f2aa66d4b6e82b0b3fa56ef /lib/gitlab/danger | |
parent | 3441092b3840cecb913068542ee9242ea19a2017 (diff) |
Add new GitlabDanger class
This class encapsulates our use of the Danger gem.
Diffstat (limited to 'lib/gitlab/danger')
-rw-r--r-- | lib/gitlab/danger/helper.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/gitlab/danger/helper.rb b/lib/gitlab/danger/helper.rb index 17ad07bfc0c..e2911b4e6c8 100644 --- a/lib/gitlab/danger/helper.rb +++ b/lib/gitlab/danger/helper.rb @@ -38,8 +38,17 @@ module Gitlab ENV['CI_PROJECT_NAME'] == 'gitlab-ee' || File.exist?('../../CHANGELOG-EE.md') end + def gitlab_helper + # Unfortunately the following does not work: + # - respond_to?(:gitlab) + # - respond_to?(:gitlab, true) + gitlab + rescue NoMethodError + nil + end + def release_automation? - gitlab.mr_author == RELEASE_TOOLS_BOT + gitlab_helper&.mr_author == RELEASE_TOOLS_BOT end def project_name |