Sha256: d5ef0a6b002d11d7f714f560e4135c5dc71af94f105e348e64bd9aa2206cfdf6

Contents?: true

Size: 1.01 KB

Versions: 160

Compression:

Stored size: 1.01 KB

Contents

# http://github.com/surf-build/surf
require "danger/request_sources/github/github"

module Danger
  # ### CI Setup
  #
  # You want to add `bundle exec danger` to your `build.sh` file to run  Danger at the
  # end of your build.
  #
  # ### Token Setup
  #
  # 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] && !env[x].empty? }
    end

    def self.validates_as_pr?(env)
      validates_as_ci?(env)
    end

    def supported_request_sources
      @supported_request_sources ||= [Danger::RequestSources::GitHub]
    end

    def initialize(env)
      self.repo_slug = env["SURF_NWO"]
      if env["SURF_PR_NUM"].to_i > 0
        self.pull_request_id = env["SURF_PR_NUM"]
      end

      self.repo_url = env["SURF_REPO"]
    end
  end
end

Version data entries

160 entries across 160 versions & 2 rubygems

Version Path
danger-additional-logging-0.0.23 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.22 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.21 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.20 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.19 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.18 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.17 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.16 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.15 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.14 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.13 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.12 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.11 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.10 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.9 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.8 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.7 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.6 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.5 lib/danger/ci_source/surf.rb
danger-additional-logging-0.0.4 lib/danger/ci_source/surf.rb