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



33
34
35
# File 'fastlane/lib/fastlane/actions/git_pull.rb', line 33

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

.available_optionsObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'fastlane/lib/fastlane/actions/git_pull.rb', line 20

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)
  ]
end

.categoryObject



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

def self.category
  :source_control
end

.descriptionObject



16
17
18
# File 'fastlane/lib/fastlane/actions/git_pull.rb', line 16

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

.example_codeObject



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

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

.is_supported?(platform) ⇒ Boolean

Returns:



37
38
39
# File 'fastlane/lib/fastlane/actions/git_pull.rb', line 37

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



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

def self.run(params)
  commands = []

  unless params[:only_tags]
    commands += ["git pull &&"]
  end

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

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