lib/danger/ci_source/circle.rb in danger-2.1.3 vs lib/danger/ci_source/circle.rb in danger-2.1.4
- old
+ new
@@ -27,10 +27,10 @@
env.key? "CIRCLE_BUILD_NUM"
end
def self.validates_as_pr?(env)
# This will get used if it's available, instead of the API faffing.
- return true if env["CI_PULL_REQUEST"]
+ return true unless env["CI_PULL_REQUEST"].empty?
# Real-world talk, it should be worrying if none of these are in the environment
return false unless ["CIRCLE_CI_API_TOKEN", "CIRCLE_PROJECT_USERNAME", "CIRCLE_PROJECT_REPONAME", "CIRCLE_BUILD_NUM"].all? { |x| env[x] }
# Uses the Circle API to determine if it's a PR otherwose