Sha256: 0fab69a493a865b4d5765d2f20735a10d4202a61047ff5d8e57f7ddd3ba77f73

Contents?: true

Size: 1.3 KB

Versions: 46

Compression:

Stored size: 1.3 KB

Contents

module Danger
  # ### CI Setup
  #
  # In order to work with Xcode Cloud and Danger, you will need to add `bundle exec danger` to
  # the `ci_scripts/ci_post_xcodebuild.sh` (Xcode Cloud's expected filename for a post-action build script).
  # More details and documentation on Xcode Cloud configuration can be found [here](https://developer.apple.com/documentation/xcode/writing-custom-build-scripts).
  #
  # ### Token Setup
  #
  # You will need to add the `DANGER_GITHUB_API_TOKEN` to your build environment.
  # If running on GitHub Enterprise, make sure you also set the expected values for
  # both `DANGER_GITHUB_API_HOST` and `DANGER_GITHUB_HOST`.
  #
  class XcodeCloud < CI
    def self.validates_as_ci?(env)
      env.key? "CI_XCODEBUILD_ACTION"
    end

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

    def supported_request_sources
      @supported_request_sources ||= [
        Danger::RequestSources::GitHub,
        Danger::RequestSources::GitLab,
        Danger::RequestSources::BitbucketCloud,
        Danger::RequestSources::BitbucketServer
      ]
    end

    def initialize(env)
      self.repo_slug = env["CI_PULL_REQUEST_SOURCE_REPO"]
      self.pull_request_id = env["CI_PULL_REQUEST_NUMBER"]
      self.repo_url = env["CI_PULL_REQUEST_HTML_URL"]
    end
  end
end

Version data entries

46 entries across 46 versions & 2 rubygems

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