Class: Fastlane::Actions::GitBranchAction

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

Documentation collapse

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, sh, step_text

Class Method Details

.authorsObject


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

def self.authors
  ["KrauseFx"]
end

.available_optionsObject


24
25
26
# File 'lib/fastlane/actions/git_branch.rb', line 24

def self.available_options
  []
end

.descriptionObject


16
17
18
# File 'lib/fastlane/actions/git_branch.rb', line 16

def self.description
  "Returns the name of the current git branch"
end

.detailsObject


20
21
22
# File 'lib/fastlane/actions/git_branch.rb', line 20

def self.details
  "If no branch could be found, this action will return nil"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)

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

def self.is_supported?(platform)
  true
end

.outputObject


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

def self.output
  []
end

.run(params) ⇒ Object


8
9
10
# File 'lib/fastlane/actions/git_branch.rb', line 8

def self.run(params)
  ENV['GIT_BRANCH'] or `git symbolic-ref HEAD --short 2>/dev/null`.strip
end