Class: Fastlane::Actions::PushGitTagsAction

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

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES

Documentation collapse

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, lane_context, method_missing, other_action, output, return_value, sample_return_value, sh, step_text

Class Method Details

.authorObject



45
46
47
# File 'lib/fastlane/actions/push_git_tags.rb', line 45

def self.author
  ['vittoriom']
end

.available_optionsObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/fastlane/actions/push_git_tags.rb', line 30

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :force,
                                 env_name: "FL_PUSH_GIT_FORCE",
                                 description: "Force push to remote. Defaults to false",
                                 is_string: false,
                                 default_value: false,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :remote,
                                 env_name: "FL_GIT_PUSH_REMOTE",
                                 description: "The remote to push tags to",
                                 optional: true)
  ]
end

.categoryObject



63
64
65
# File 'lib/fastlane/actions/push_git_tags.rb', line 63

def self.category
  :source_control
end

.descriptionObject



26
27
28
# File 'lib/fastlane/actions/push_git_tags.rb', line 26

def self.description
  "Push local tags to the remote - this will only push tags"
end

.detailsObject



49
50
51
# File 'lib/fastlane/actions/push_git_tags.rb', line 49

def self.details
  "If you only want to push the tags and nothing else, you can use the `push_git_tags` action"
end

.example_codeObject



57
58
59
60
61
# File 'lib/fastlane/actions/push_git_tags.rb', line 57

def self.example_code
  [
    'push_git_tags'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/fastlane/actions/push_git_tags.rb', line 53

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



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

def self.run(params)
  command = [
    'git',
    'push',
    '--tags'
  ]

  # optionally add the force component
  command << '--force' if params[:force]

  # optionally add the remote component
  command << params[:remote] if params[:remote]

  result = Actions.sh(command.join(' '))
  UI.success('Tags pushed to remote')
  result
end