Class: Fastlane::Actions::EnsureEnvVarsAction
Constant Summary
Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES
Class Method Summary
collapse
action_name, author, deprecated_notes, lane_context, method_missing, other_action, output, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text
Class Method Details
.authors ⇒ Object
37
38
39
|
# File 'fastlane/lib/fastlane/actions/ensure_env_vars.rb', line 37
def self.authors
['revolter']
end
|
.available_options ⇒ Object
26
27
28
29
30
31
32
33
34
35
|
# File 'fastlane/lib/fastlane/actions/ensure_env_vars.rb', line 26
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :env_vars,
description: 'The environment variables names that should be checked',
type: Array,
verify_block: proc do |value|
UI.user_error!('Specify at least one environment variable name') if value.empty?
end)
]
end
|
.category ⇒ Object
49
50
51
|
# File 'fastlane/lib/fastlane/actions/ensure_env_vars.rb', line 49
def self.category
:misc
end
|
.description ⇒ Object
18
19
20
|
# File 'fastlane/lib/fastlane/actions/ensure_env_vars.rb', line 18
def self.description
'Raises an exception if the specified env vars are not set'
end
|
.details ⇒ Object
22
23
24
|
# File 'fastlane/lib/fastlane/actions/ensure_env_vars.rb', line 22
def self.details
'This action will check if some environment variables are set.'
end
|
.example_code ⇒ Object
41
42
43
44
45
46
47
|
# File 'fastlane/lib/fastlane/actions/ensure_env_vars.rb', line 41
def self.example_code
[
'ensure_env_vars(
env_vars: [\'GITHUB_USER_NAME\', \'GITHUB_API_TOKEN\']
)'
]
end
|
.is_supported?(platform) ⇒ Boolean
53
54
55
|
# File 'fastlane/lib/fastlane/actions/ensure_env_vars.rb', line 53
def self.is_supported?(platform)
true
end
|
.run(params) ⇒ Object
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# File 'fastlane/lib/fastlane/actions/ensure_env_vars.rb', line 4
def self.run(params)
variables = params[:env_vars]
variables.each do |variable|
next unless ENV[variable].to_s.strip.empty?
UI.user_error!("Missing environment variable '#{variable}'")
end
is_one = variables.length == 1
UI.success("Environment variable#{is_one ? '' : 's'} '#{variables.join('\', \'')}' #{is_one ? 'is' : 'are'} set!")
end
|