Class: Pantograph::Actions::GitBranchAction

Inherits:
Pantograph::Action show all
Defined in:
pantograph/lib/pantograph/actions/git_branch.rb

Constant Summary

Constants inherited from Pantograph::Action

Pantograph::Action::AVAILABLE_CATEGORIES, Pantograph::Action::RETURN_TYPES

Documentation collapse

Class Method Summary collapse

Methods inherited from Pantograph::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



34
35
36
# File 'pantograph/lib/pantograph/actions/git_branch.rb', line 34

def self.authors
  ['johnknapprs']
end

.available_optionsObject



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

def self.available_options
  []
end

.categoryObject



52
53
54
# File 'pantograph/lib/pantograph/actions/git_branch.rb', line 52

def self.category
  :source_control
end

.descriptionObject



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

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

.detailsObject



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

def self.details
  'If no branch could be found, this action will return an empty string'
end

.example_codeObject



42
43
44
45
46
# File 'pantograph/lib/pantograph/actions/git_branch.rb', line 42

def self.example_code
  [
    'git_branch'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



38
39
40
# File 'pantograph/lib/pantograph/actions/git_branch.rb', line 38

def self.is_supported?(platform)
  true
end

.outputObject



28
29
30
31
32
# File 'pantograph/lib/pantograph/actions/git_branch.rb', line 28

def self.output
  [
    ['GIT_BRANCH_NAME', 'The git branch name']
  ]
end

.return_typeObject



48
49
50
# File 'pantograph/lib/pantograph/actions/git_branch.rb', line 48

def self.return_type
  :string
end

.run(params) ⇒ Object



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

def self.run(params)
  Actions.lane_context[SharedValues::GIT_BRANCH_NAME] = Helper::Git.current_branch
end