class Danger::Codemagic
and ‘DANGER_BITBUCKETSERVER_HOST` to your build user’s ENV.
Add the ‘DANGER_BITBUCKETSERVER_USERNAME`, `DANGER_BITBUCKETSERVER_PASSWORD`
#### Bitbucket server
to your build user’s ENV.
Add the ‘DANGER_BITBUCKETSERVER_USERNAME`, `DANGER_BITBUCKETSERVER_PASSWORD`
#### Bitbucket Cloud
Add the `DANGER_GITLAB_API_TOKEN` to your build user’s ENV.
#### GitLab
Add the ‘DANGER_GITHUB_API_TOKEN` to your build user’s ENV.
#### GitHub
/
Add the following environment variables to your workflow’s environment configuration.
### Token Setup
“‘
bundle exec danger
bundle install
script: |
- name: Running Danger
“`
Add a script step to your workflow:
### CI Setup
def self.validates_as_ci?(env)
def self.validates_as_ci?(env) env.key? "FCI_PROJECT_ID" end
def self.validates_as_pr?(env)
def self.validates_as_pr?(env) return !env["FCI_PULL_REQUEST_NUMBER"].to_s.empty? end
def initialize(env)
def initialize(env) self.pull_request_id = env["FCI_PULL_REQUEST_NUMBER"] self.repo_slug = env["FCI_REPO_SLUG"] self.repo_url = GitRepo.new.origins # Codemagic doesn't provide a repo url env variable for n end
def supported_request_sources
def supported_request_sources @supported_request_sources ||= [ Danger::RequestSources::GitHub, Danger::RequestSources::GitLab, Danger::RequestSources::BitbucketServer, Danger::RequestSources::BitbucketCloud ] end