forked from fastlane/fastlane
-
Notifications
You must be signed in to change notification settings - Fork 0
/
git_remote_branch.rb
57 lines (47 loc) 路 1.44 KB
/
git_remote_branch.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
module Fastlane
module Actions
class GitRemoteBranchAction < Action
def self.run(params)
Actions.git_remote_branch_name(params[:remote_name])
end
#####################################################
# @!group Documentation
#####################################################
def self.description
"Returns the name of the current git remote default branch"
end
def self.details
"If no default remote branch could be found, this action will return nil. This is a wrapper for the internal action Actions.git_default_remote_branch_name"
end
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :remote_name,
env_name: "FL_REMOTE_REPOSITORY_NAME",
description: "The remote repository to check",
optional: true)
]
end
def self.output
[]
end
def self.authors
["SeanMcNeil"]
end
def self.is_supported?(platform)
true
end
def self.example_code
[
'git_remote_branch # Query git for first available remote name',
'git_remote_branch(remote_name:"upstream") # Provide a remote name'
]
end
def self.return_type
:string
end
def self.category
:source_control
end
end
end
end