lib/danger/ci_source/jenkins.rb in danger-6.0.1 vs lib/danger/ci_source/jenkins.rb in danger-6.0.2

- old
+ new

@@ -45,10 +45,11 @@ # # #### GitLab # As you own the machine, it's up to you to add the environment variable for the `DANGER_GITLAB_API_TOKEN`. # class Jenkins < CI + attr_accessor :project_url class EnvNotFound < StandardError def initialize super("ENV not found, please check your Jenkins. Related: https://stackoverflow.com/search?q=jenkins+env+null") end end @@ -77,9 +78,10 @@ raise EnvNotFound.new if env.nil? || env.empty? self.repo_url = self.class.repo_url(env) self.pull_request_id = self.class.pull_request_id(env) self.repo_slug = self.class.repo_slug(self.repo_url) + self.project_url = env["CI_MERGE_REQUEST_PROJECT_URL"] || env["CI_PROJECT_URL"] end def self.repo_slug(repo_url) slug = self.slug_ssh(repo_url) slug = self.slug_http(repo_url) unless slug