Sha256: c53555f56f2f8dc154a2a3debd3e5c5c5770f59cea632bc609f45f7499a065f8

Contents?: true

Size: 801 Bytes

Versions: 1

Compression:

Stored size: 801 Bytes

Contents

# https://buildkite.com/docs/agent/osx
# https://buildkite.com/docs/guides/environment-variables

module Danger
  module CISource
    class Buildkite < CI
      def self.validates?(env)
        return false unless env['BUILDKITE']
        return false unless env['BUILDKITE_REPO']
        return false unless env['BUILDKITE_PULL_REQUEST']

        return true
      end

      def initialize(env)
        self.repo_url = env['BUILDKITE_REPO']
        self.pull_request_id = env['BUILDKITE_PULL_REQUEST']

        repo_matches = self.repo_url.match(%r{([\/:])([^\/]+\/[^\/.]+)(?:.git)?$})
        self.repo_slug = repo_matches[2] unless repo_matches.nil?
      end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
danger-0.8.5 lib/danger/ci_source/buildkite.rb