Class: Fastlane::Actions::PushGitTagsAction

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

Constant Summary

Constants inherited from Fastlane::Action

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

Documentation collapse

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, deprecated_notes, 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

.authorObject



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

def self.author
  ['vittoriom']
end

.available_optionsObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'fastlane/lib/fastlane/actions/push_git_tags.rb', line 33

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :force,
                                 env_name: "FL_PUSH_GIT_FORCE",
                                 description: "Force push to remote",
                                 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",
                                 default_value: "origin",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :tag,
                                 env_name: "FL_GIT_PUSH_TAG",
                                 description: "The tag to push to remote",
                                 optional: true)
  ]
end

.categoryObject



71
72
73
# File 'fastlane/lib/fastlane/actions/push_git_tags.rb', line 71

def self.category
  :source_control
end

.descriptionObject



29
30
31
# File 'fastlane/lib/fastlane/actions/push_git_tags.rb', line 29

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

.detailsObject



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

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



65
66
67
68
69
# File 'fastlane/lib/fastlane/actions/push_git_tags.rb', line 65

def self.example_code
  [
    'push_git_tags'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



61
62
63
# File 'fastlane/lib/fastlane/actions/push_git_tags.rb', line 61

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
21
22
23
# File 'fastlane/lib/fastlane/actions/push_git_tags.rb', line 4

def self.run(params)
  command = [
    'git',
    'push',
    params[:remote]
  ]

  if params[:tag]
    command << "refs/tags/#{params[:tag]}"
  else
    command << '--tags'
  end

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

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