class Fastlane::Actions::PrepareGitRepositoryAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/mobile_common/actions/prepare_git_repository.rb, line 49
def self.authors
  # So no one will ever forget your contribution to fastlane :) You are awesome btw!
  ["SemenovAlexander"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/mobile_common/actions/prepare_git_repository.rb, line 30
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :branch,
                                 env_name: "FL_PREPARE_GIT_REPOSITORY_BRANCH",
                                 description: "Git branch to checkout and track for rest of fastlane",
                                 default_value: "master",
                                 verify_block: proc do |value|
                                   UI.user_error!("No branch for PrepareGitRepositoryAction given, pass using `branch: 'branch'`") unless value and !value.empty?
                                 end),
    FastlaneCore::ConfigItem.new(key: :remote,
                                 env_name: "FL_PREPARE_GIT_REPOSITORY_REMOTE",
                                 description: "Git remote name to checkout and track for rest of fastlane",
                                 default_value: "origin",
                                 verify_block: proc do |value|
                                   UI.user_error!("No git remote for PrepareGitRepositoryAction given, pass using `remote: 'origin'`") unless value and !value.empty?
                                 end)
  ]
end
description() click to toggle source

@!group Documentation

# File lib/fastlane/plugin/mobile_common/actions/prepare_git_repository.rb, line 20
def self.description
  "Prepares repo for fastlane to work"
end
details() click to toggle source
# File lib/fastlane/plugin/mobile_common/actions/prepare_git_repository.rb, line 24
def self.details
  # Optional:
  # this is your chance to provide a more detailed description of this action
  "You can use this action to do cool things..."
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/mobile_common/actions/prepare_git_repository.rb, line 54
def self.is_supported?(platform)
  true
end
run(params) click to toggle source
# File lib/fastlane/plugin/mobile_common/actions/prepare_git_repository.rb, line 7
def self.run(params)
  git_branch = params[:branch]
  remote = params[:remote]
  sh("git checkout #{git_branch}")
  sh("git remote set-branches --add #{remote} #{git_branch}")
  sh("git branch --set-upstream-to=refs/remotes/#{remote}/#{git_branch} #{git_branch}")
  other_action.git_pull
end