Sha256: eb7844f3c0912b8750246267c72aa248a43564c5927c37c6c6cb514eb7b2a8c3
Contents?: true
Size: 1.06 KB
Versions: 42
Compression:
Stored size: 1.06 KB
Contents
# http://docs.gitlab.com/ce/ci/variables/README.html require "uri" require "danger/request_sources/gitlab" module Danger # ### CI Setup # GitLab CI is currently not supported because GitLab's runners don't expose # the required values in the environment. Namely CI_MERGE_REQUEST_ID does not # exist as of yet, however there is an # [MR](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5698) fixing this. # If that has been merged and you are using either gitlab.com or a release # with that change this CISource will work. # class GitLabCI < CI def self.validates_as_ci?(env) env.key? "GITLAB_CI" end def self.validates_as_pr?(env) exists = ["CI_MERGE_REQUEST_ID", "CI_PROJECT_ID", "GITLAB_CI"].all? { |x| env[x] } exists && env["CI_MERGE_REQUEST_ID"].to_i > 0 end def supported_request_sources @supported_request_sources ||= [Danger::RequestSources::GitLab] end def initialize(env) self.repo_slug = env["CI_PROJECT_ID"] self.pull_request_id = env["CI_MERGE_REQUEST_ID"] end end end
Version data entries
42 entries across 42 versions & 1 rubygems
Version | Path |
---|---|
danger-3.3.2 | lib/danger/ci_source/gitlab_ci.rb |
danger-3.3.1 | lib/danger/ci_source/gitlab_ci.rb |