Class: Fastlane::Actions::GitPullAction

Inherits:
Fastlane::Action show all
Defined in:
fastlane/lib/fastlane/actions/git_pull.rb

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, deprecated_notes, details, lane_context, method_missing, other_action, output, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorsObject



43
44
45
# File 'fastlane/lib/fastlane/actions/git_pull.rb', line 43

def self.authors
  ["KrauseFx", "JaviSoto"]
end

.available_optionsObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'fastlane/lib/fastlane/actions/git_pull.rb', line 22

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :only_tags,
                                 description: "Simply pull the tags, and not bring new commits to the current branch from the remote",
                                 is_string: false,
                                 optional: true,
                                 default_value: false,
                                 verify_block: proc do |value|
                                   UI.user_error!("Please pass a valid value for only_tags. Use one of the following: true, false") unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass)
                                 end),
    FastlaneCore::ConfigItem.new(key: :rebase,
                                 description: "Rebase on top of the remote branch instead of merge",
                                 is_string: false,
                                 optional: true,
                                 default_value: false,
                                 verify_block: proc do |value|
                                   UI.user_error!("Please pass a valid value for rebase. Use one of the following: true, false") unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass)
                                 end)
  ]
end

.categoryObject



59
60
61
# File 'fastlane/lib/fastlane/actions/git_pull.rb', line 59

def self.category
  :source_control
end

.descriptionObject



18
19
20
# File 'fastlane/lib/fastlane/actions/git_pull.rb', line 18

def self.description
  "Executes a simple git pull command"
end

.example_codeObject



51
52
53
54
55
56
57
# File 'fastlane/lib/fastlane/actions/git_pull.rb', line 51

def self.example_code
  [
    'git_pull',
    'git_pull(only_tags: true) # only the tags, no commits',
    'git_pull(rebase: true) # use --rebase with pull'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



47
48
49
# File 'fastlane/lib/fastlane/actions/git_pull.rb', line 47

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'fastlane/lib/fastlane/actions/git_pull.rb', line 4

def self.run(params)
  commands = []

  unless params[:only_tags]
    command = "git pull"
    command << " --rebase" if params[:rebase]
    commands += ["#{command} &&"]
  end

  commands += ["git fetch --tags"]

  Actions.sh(commands.join(' '))
end