Class: Fastlane::Actions::EnsureGitBranchAction
Overview
Raises an exception and stop the lane execution if the repo is not on a specific branch
Class Method Summary
collapse
action_name, authors, details, sh, step_text
Class Method Details
.author ⇒ Object
40
41
42
|
# File 'lib/fastlane/actions/ensure_git_branch.rb', line 40
def self.author
'dbachrach'
end
|
.available_options ⇒ Object
26
27
28
29
30
31
32
33
34
|
# File 'lib/fastlane/actions/ensure_git_branch.rb', line 26
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :branch,
env_name: "FL_ENSURE_GIT_BRANCH_NAME",
description: "The branch that should be checked for",
is_string: true,
default_value: 'master'),
]
end
|
.description ⇒ Object
22
23
24
|
# File 'lib/fastlane/actions/ensure_git_branch.rb', line 22
def self.description
"Raises an exception if not on a specific git branch"
end
|
.is_supported?(platform) ⇒ Boolean
44
45
46
|
# File 'lib/fastlane/actions/ensure_git_branch.rb', line 44
def self.is_supported?(platform)
true
end
|
.output ⇒ Object
36
37
38
|
# File 'lib/fastlane/actions/ensure_git_branch.rb', line 36
def self.output
[]
end
|
.run(params) ⇒ Object
8
9
10
11
12
13
14
15
|
# File 'lib/fastlane/actions/ensure_git_branch.rb', line 8
def self.run(params)
branch = params[:branch]
if Actions.git_branch != branch
raise "Git is not on the `#{branch}` branch, but on `#{Actions.git_branch}`! Please ensure the repo is checked out to the correct branch.".red
else
Helper.log.info "Git branch is `#{branch}`, all good! 💪".green
end
end
|