Sha256: 7afa66c998b5077bf7a9c1e2d5abef7c274b08d89d8adc1c24af7b415c052b65

Contents?: true

Size: 1.03 KB

Versions: 44

Compression:

Stored size: 1.03 KB

Contents

module Danger
  # ### CI Setup
  #
  # Install dependencies and add a danger step to your `bitbucket-pipelines.yml`.
  #
  # ```yaml
  #   script:
  #     - bundle exec danger --verbose
  # ```
  #
  # ### Token Setup
  #
  # Add `DANGER_BITBUCKETCLOUD_USERNAME` and `DANGER_BITBUCKETCLOUD_PASSWORD` to your pipeline repository variable
  # or instead using `DANGER_BITBUCKETCLOUD_OAUTH_KEY` and `DANGER_BITBUCKETCLOUD_OAUTH_SECRET`.
  #
  # You can find them in Settings > Pipelines > Repository Variables

  class BitbucketPipelines < CI
    def self.validates_as_ci?(env)
      env.key? "BITBUCKET_BUILD_NUMBER"
    end

    def self.validates_as_pr?(env)
      env.key? "BITBUCKET_PR_ID"
    end

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

    def initialize(env)
      self.repo_url = env["BITBUCKET_GIT_HTTP_ORIGIN"]
      self.repo_slug = "#{env['BITBUCKET_REPO_OWNER']}/#{env['BITBUCKET_REPO_SLUG']}"
      self.pull_request_id = env["BITBUCKET_PR_ID"]
    end
  end
end

Version data entries

44 entries across 44 versions & 2 rubygems

Version Path
danger-9.4.3 lib/danger/ci_source/bitbucket_pipelines.rb
danger-9.4.2 lib/danger/ci_source/bitbucket_pipelines.rb
danger-9.4.1 lib/danger/ci_source/bitbucket_pipelines.rb
danger-9.4.0 lib/danger/ci_source/bitbucket_pipelines.rb
danger-9.3.2 lib/danger/ci_source/bitbucket_pipelines.rb
danger-additional-logging-0.0.36 lib/danger/ci_source/bitbucket_pipelines.rb
danger-additional-logging-0.0.35 lib/danger/ci_source/bitbucket_pipelines.rb
danger-additional-logging-0.0.34 lib/danger/ci_source/bitbucket_pipelines.rb
danger-additional-logging-0.0.33 lib/danger/ci_source/bitbucket_pipelines.rb
danger-additional-logging-0.0.32 lib/danger/ci_source/bitbucket_pipelines.rb
danger-additional-logging-0.0.31 lib/danger/ci_source/bitbucket_pipelines.rb
danger-additional-logging-0.0.30 lib/danger/ci_source/bitbucket_pipelines.rb
danger-additional-logging-0.0.29 lib/danger/ci_source/bitbucket_pipelines.rb
danger-additional-logging-0.0.28 lib/danger/ci_source/bitbucket_pipelines.rb
danger-additional-logging-0.0.27 lib/danger/ci_source/bitbucket_pipelines.rb
danger-additional-logging-0.0.26 lib/danger/ci_source/bitbucket_pipelines.rb
danger-additional-logging-0.0.25 lib/danger/ci_source/bitbucket_pipelines.rb
danger-additional-logging-0.0.24 lib/danger/ci_source/bitbucket_pipelines.rb
danger-additional-logging-0.0.23 lib/danger/ci_source/bitbucket_pipelines.rb
danger-additional-logging-0.0.22 lib/danger/ci_source/bitbucket_pipelines.rb