class Danger::BitbucketPipelines

### CI Setup

Install dependencies and add a danger step to your ‘bitbucket-pipelines.yml`.

“‘yaml

script:
  - bundle exec danger --verbose

“‘

### Token Setup

For username and password, you need to set.

For OAuth key and OAuth secret, you can get them from.

For [repository access token](support.atlassian.com/bitbucket-cloud/docs/repository-access-tokens/), what you need to create one is:

Public Class Methods

new(env) click to toggle source
# File lib/danger/ci_source/bitbucket_pipelines.rb, line 52
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
validates_as_ci?(env) click to toggle source
# File lib/danger/ci_source/bitbucket_pipelines.rb, line 40
def self.validates_as_ci?(env)
  env.key? "BITBUCKET_BUILD_NUMBER"
end
validates_as_pr?(env) click to toggle source
# File lib/danger/ci_source/bitbucket_pipelines.rb, line 44
def self.validates_as_pr?(env)
  env.key? "BITBUCKET_PR_ID"
end

Public Instance Methods

supported_request_sources() click to toggle source
# File lib/danger/ci_source/bitbucket_pipelines.rb, line 48
def supported_request_sources
  @supported_request_sources ||= [Danger::RequestSources::BitbucketCloud]
end