Class: Fastlane::Actions::HgAddTagAction

Inherits:
Fastlane::Action show all
Defined in:
fastlane/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, Fastlane::Action::RETURN_TYPES

Class Method Summary collapse

Methods inherited from Fastlane::Action

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

.authorObject



28
29
30
31
# File 'fastlane/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 'fastlane/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 'fastlane/lib/fastlane/actions/hg_add_tag.rb', line 43

def self.category
  :source_control
end

.descriptionObject



16
17
18
# File 'fastlane/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 'fastlane/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:



33
34
35
# File 'fastlane/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 'fastlane/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.test?

  Actions.sh(command)
end