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

- old
+ new

@@ -11,14 +11,14 @@ # As this is self-hosted, you will need to add the `DANGER_GITHUB_API_TOKEN` to your build user's ENV. The alternative # is to pass in the token as a prefix to the command `DANGER_GITHUB_API_TOKEN="123" bundle exec danger`. # class Surf < CI def self.validates_as_ci?(env) - return ["SURF_REPO", "SURF_NWO"].all? { |x| env[x] } + return ["SURF_REPO", "SURF_NWO"].all? { |x| env[x] && !env[x].empty? } end - def self.validates_as_pr?(_) - true + def self.validates_as_pr?(env) + validates_as_ci?(env) end def supported_request_sources @supported_request_sources ||= [Danger::RequestSources::GitHub] end