class Fastlane::Actions::GitBranchAction

Public Class Methods

authors() click to toggle source
# File fastlane/lib/fastlane/actions/git_branch.rb, line 35
def self.authors
  ["KrauseFx"]
end
available_options() click to toggle source
# File fastlane/lib/fastlane/actions/git_branch.rb, line 25
def self.available_options
  []
end
category() click to toggle source
# File fastlane/lib/fastlane/actions/git_branch.rb, line 53
def self.category
  :source_control
end
description() click to toggle source

@!group Documentation

# File fastlane/lib/fastlane/actions/git_branch.rb, line 17
def self.description
  "Returns the name of the current git branch, possibly as managed by CI ENV vars"
end
details() click to toggle source
# File fastlane/lib/fastlane/actions/git_branch.rb, line 21
def self.details
  "If no branch could be found, this action will return an empty string"
end
example_code() click to toggle source
# File fastlane/lib/fastlane/actions/git_branch.rb, line 43
def self.example_code
  [
    'git_branch'
  ]
end
is_supported?(platform) click to toggle source
# File fastlane/lib/fastlane/actions/git_branch.rb, line 39
def self.is_supported?(platform)
  true
end
output() click to toggle source
# File fastlane/lib/fastlane/actions/git_branch.rb, line 29
def self.output
  [
    ['GIT_BRANCH_ENV_VARS', 'The git branch environment variables']
  ]
end
return_type() click to toggle source
# File fastlane/lib/fastlane/actions/git_branch.rb, line 49
def self.return_type
  :string
end
run(params) click to toggle source
# File fastlane/lib/fastlane/actions/git_branch.rb, line 8
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