Class: Fastlane::Actions::GitBranchAction

Inherits:
Fastlane::Action show all
Defined in:
fastlane/lib/fastlane/actions/git_branch.rb

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Documentation collapse

Class Method Summary collapse

Methods inherited from Fastlane::Action

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

.authorsObject



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

def self.authors
  ["KrauseFx"]
end

.available_optionsObject



22
23
24
# File 'fastlane/lib/fastlane/actions/git_branch.rb', line 22

def self.available_options
  []
end

.categoryObject



50
51
52
# File 'fastlane/lib/fastlane/actions/git_branch.rb', line 50

def self.category
  :source_control
end

.descriptionObject



14
15
16
# File 'fastlane/lib/fastlane/actions/git_branch.rb', line 14

def self.description
  "Returns the name of the current git branch, possibly as managed by CI ENV vars"
end

.detailsObject



18
19
20
# File 'fastlane/lib/fastlane/actions/git_branch.rb', line 18

def self.details
  "If no branch could be found, this action will return an empty string. This is a wrapper for the internal action Actions.git_branch"
end

.example_codeObject



40
41
42
43
44
# File 'fastlane/lib/fastlane/actions/git_branch.rb', line 40

def self.example_code
  [
    'git_branch'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



36
37
38
# File 'fastlane/lib/fastlane/actions/git_branch.rb', line 36

def self.is_supported?(platform)
  true
end

.outputObject



26
27
28
29
30
# File 'fastlane/lib/fastlane/actions/git_branch.rb', line 26

def self.output
  [
    ['GIT_BRANCH_ENV_VARS', 'The git branch environment variables']
  ]
end

.return_typeObject



46
47
48
# File 'fastlane/lib/fastlane/actions/git_branch.rb', line 46

def self.return_type
  :string
end

.run(params) ⇒ Object



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

def self.run(params)
  branch = Actions.git_branch || ""
  return "" if branch == "HEAD" # Backwards compatibility with the original (and documented) implementation
  branch
end