Class: Fastlane::Actions::HgAddTagAction

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

Overview

Adds a hg tag to the current commit

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES

Class Method Summary collapse

Methods inherited from Fastlane::Action

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

Class Method Details

.authorObject



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

def self.author
  # credits to lmirosevic for original git version
  "sjrmanning"
end

.available_optionsObject



20
21
22
23
24
25
26
# File 'lib/fastlane/actions/hg_add_tag.rb', line 20

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :tag,
                                 env_name: "FL_HG_TAG_TAG",
                                 description: "Tag to create")
  ]
end

.categoryObject



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

def self.category
  :source_control
end

.descriptionObject



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

def self.description
  "This will add a hg tag to the current branch"
end

.example_codeObject



37
38
39
40
41
# File 'lib/fastlane/actions/hg_add_tag.rb', line 37

def self.example_code
  [
    'hg_add_tag(tag: "1.3")'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


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

def self.is_supported?(platform)
  true
end

.run(options) ⇒ Object



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

def self.run(options)
  tag = options[:tag]

  UI.message("Adding mercurial tag '#{tag}' 🎯.")

  command = "hg tag \"#{tag}\""
  return command if Helper.is_test?

  Actions.sh(command)
end