Class: Fastlane::Actions::GitBranchAction
Constant Summary
Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES
Class Method Summary
collapse
action_name, author, deprecated_notes, lane_context, method_missing, other_action, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text
Class Method Details
.authors ⇒ Object
38
39
40
|
# File 'fastlane/lib/fastlane/actions/git_branch.rb', line 38
def self.authors
["KrauseFx"]
end
|
.available_options ⇒ Object
28
29
30
|
# File 'fastlane/lib/fastlane/actions/git_branch.rb', line 28
def self.available_options
[]
end
|
.category ⇒ Object
56
57
58
|
# File 'fastlane/lib/fastlane/actions/git_branch.rb', line 56
def self.category
:source_control
end
|
.description ⇒ Object
20
21
22
|
# File 'fastlane/lib/fastlane/actions/git_branch.rb', line 20
def self.description
"Returns the name of the current git branch, possibly as managed by CI ENV vars"
end
|
.details ⇒ Object
24
25
26
|
# File 'fastlane/lib/fastlane/actions/git_branch.rb', line 24
def self.details
"If no branch could be found, this action will return an empty string"
end
|
.example_code ⇒ Object
46
47
48
49
50
|
# File 'fastlane/lib/fastlane/actions/git_branch.rb', line 46
def self.example_code
[
'git_branch'
]
end
|
.is_supported?(platform) ⇒ Boolean
42
43
44
|
# File 'fastlane/lib/fastlane/actions/git_branch.rb', line 42
def self.is_supported?(platform)
true
end
|
.output ⇒ Object
32
33
34
35
36
|
# File 'fastlane/lib/fastlane/actions/git_branch.rb', line 32
def self.output
[
['GIT_BRANCH_ENV_VARS', 'The git branch environment variables']
]
end
|
.return_type ⇒ Object
52
53
54
|
# File 'fastlane/lib/fastlane/actions/git_branch.rb', line 52
def self.return_type
:string
end
|
.run(params) ⇒ Object
11
12
13
14
|
# File 'fastlane/lib/fastlane/actions/git_branch.rb', line 11
def self.run(params)
env_name = SharedValues::GIT_BRANCH_ENV_VARS.find { |env_var| FastlaneCore::Env.truthy?(env_var) }
ENV.fetch(env_name.to_s) { `git symbolic-ref HEAD --short 2>/dev/null`.strip }
end
|