From 456ff7935f2a3e0b4041d2b27c54bd35354dd743 Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Fri, 12 Feb 2016 12:17:43 +0000 Subject: [PATCH] Use CI for base/head --- lib/danger/commands/local.rb | 2 ++ lib/danger/dangerfile.rb | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/danger/commands/local.rb b/lib/danger/commands/local.rb index b47f23174..5086343b7 100644 --- a/lib/danger/commands/local.rb +++ b/lib/danger/commands/local.rb @@ -37,6 +37,8 @@ def run puts "" gh = GitHub.new(dm.env.ci_source, ENV) + # We can use tokenless here, as it's running on someone's computer + # and is IP locked, as opposed to on the CI. gh.support_tokenless_auth = true gh.fetch_details diff --git a/lib/danger/dangerfile.rb b/lib/danger/dangerfile.rb index d8d6c0577..fcccd4c24 100644 --- a/lib/danger/dangerfile.rb +++ b/lib/danger/dangerfile.rb @@ -36,10 +36,10 @@ def print_known_info puts "Metadata:" puts "#{'SCM'.blue} : #{env.scm.class}" puts "#{'Source'.blue} : #{env.ci_source.class}" - puts " #{'Base commit'.blue} : #{env.ci_source.base_commit}" if env.ci_source.respond_to? :base_commit - puts " #{'HEAD commit'.blue} : #{env.ci_source.head_commit}" if env.ci_source.respond_to? :head_commit - puts " git diff #{env.ci_source.base_commit} #{env.ci_source.head_commit}".yellow puts "#{'Requests'.blue} : #{env.request_source.class}" + puts " #{'Base commit'.blue} : #{env.request_source.base_commit}" + puts " #{'HEAD commit'.blue} : #{env.request_source.head_commit}" + puts " git diff #{env.request_source.base_commit} #{env.request_source.head_commit}".yellow puts "\n\n" end