lib/danger/ci_source/circle.rb in danger-3.0.3 vs lib/danger/ci_source/circle.rb in danger-3.1.0

- old
+ new

@@ -38,10 +38,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 unless env["CI_PULL_REQUEST"].empty? + return true if env["CI_PULL_REQUEST"] && !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] && !env[x].empty? } # Uses the Circle API to determine if it's a PR otherwise