Class: Fastlane::Actions::GitTagExistsAction
Constant Summary
Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES
Class Method Summary
collapse
action_name, author, deprecated_notes, details, lane_context, method_missing, other_action, sample_return_value, shell_out_should_use_bundle_exec?, step_text
Class Method Details
.authors ⇒ Object
57
58
59
|
# File 'fastlane/lib/fastlane/actions/git_tag_exists.rb', line 57
def self.authors
["antondomashnev"]
end
|
.available_options ⇒ Object
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'fastlane/lib/fastlane/actions/git_tag_exists.rb', line 28
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :tag,
description: "The tag name that should be checked"),
FastlaneCore::ConfigItem.new(key: :remote,
description: "Whether to check remote. Defaults to `false`",
type: Boolean,
default_value: false,
optional: true),
FastlaneCore::ConfigItem.new(key: :remote_name,
description: "The remote to check. Defaults to `origin`",
default_value: 'origin',
optional: true)
]
end
|
.category ⇒ Object
73
74
75
|
# File 'fastlane/lib/fastlane/actions/git_tag_exists.rb', line 73
def self.category
:source_control
end
|
.description ⇒ Object
24
25
26
|
# File 'fastlane/lib/fastlane/actions/git_tag_exists.rb', line 24
def self.description
"Checks if the git tag with the given name exists in the current repo"
end
|
.example_code ⇒ Object
65
66
67
68
69
70
71
|
# File 'fastlane/lib/fastlane/actions/git_tag_exists.rb', line 65
def self.example_code
[
'if git_tag_exists(tag: "1.1.0")
UI.message("Found it 🚀")
end'
]
end
|
.is_supported?(platform) ⇒ Boolean
61
62
63
|
# File 'fastlane/lib/fastlane/actions/git_tag_exists.rb', line 61
def self.is_supported?(platform)
true
end
|
.output ⇒ Object
52
53
54
55
|
# File 'fastlane/lib/fastlane/actions/git_tag_exists.rb', line 52
def self.output
[
]
end
|
.return_type ⇒ Object
48
49
50
|
# File 'fastlane/lib/fastlane/actions/git_tag_exists.rb', line 48
def self.return_type
:bool
end
|
.return_value ⇒ Object
44
45
46
|
# File 'fastlane/lib/fastlane/actions/git_tag_exists.rb', line 44
def self.return_value
"Boolean value whether the tag exists or not"
end
|
.run(params) ⇒ Object
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'fastlane/lib/fastlane/actions/git_tag_exists.rb', line 4
def self.run(params)
tag_ref = "refs/tags/#{params[:tag].shellescape}"
if params[:remote]
command = "git ls-remote -q --exit-code #{params[:remote_name].shellescape} #{tag_ref}"
else
command = "git rev-parse -q --verify #{tag_ref}"
end
exists = true
Actions.sh(
command,
log: FastlaneCore::Globals.verbose?,
error_callback: ->(result) { exists = false }
)
exists
end
|