Class: Fastlane::Actions::GitTagExistsAction

Inherits:
Fastlane::Action show all
Defined in:
lib/fastlane/actions/git_tag_exists.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, author, lane_context, method_missing, other_action, sample_return_value, sh, step_text

Class Method Details

.authorsObject



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

def self.authors
  ["antondomashnev"]
end

.available_optionsObject



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

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :tag,
                                 description: "The tag name that should be checked")
  ]
end

.categoryObject



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

def self.category
  :source_control
end

.descriptionObject



13
14
15
# File 'lib/fastlane/actions/git_tag_exists.rb', line 13

def self.description
  "Checks if the git tag with the given name exists in the current repo"
end

.detailsObject



17
18
19
# File 'lib/fastlane/actions/git_tag_exists.rb', line 17

def self.details
  nil
end

.example_codeObject



45
46
47
48
49
50
51
# File 'lib/fastlane/actions/git_tag_exists.rb', line 45

def self.example_code
  [
    'if git_tag_exists(tag: "1.1.0")
      UI.message("Found it 🚀")
    end'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/fastlane/actions/git_tag_exists.rb', line 41

def self.is_supported?(platform)
  true
end

.outputObject



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

def self.output
  [
  ]
end

.return_valueObject



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

def self.return_value
  "Boolean value whether the tag exists or not"
end

.run(params) ⇒ Object



4
5
6
7
# File 'lib/fastlane/actions/git_tag_exists.rb', line 4

def self.run(params)
  result = Actions.sh("git rev-parse -q --verify refs/tags/#{params[:tag].shellescape} || true", log: $verbose).chomp
  !result.empty?
end