fastlane/lib/fastlane/runner.rb in fastlane-2.2.0 vs fastlane/lib/fastlane/runner.rb in fastlane-2.3.0
- old
+ new
@@ -107,11 +107,13 @@
nil
end
# This is being called from `method_missing` from the Fastfile
# It's also used when an action is called from another action
- def trigger_action_by_name(method_sym, custom_dir, *arguments)
+ # @param from_action Indicates if this action is being trigged by another action.
+ # If so, it won't show up in summary.
+ def trigger_action_by_name(method_sym, custom_dir, from_action, *arguments)
# First, check if there is a predefined method in the actions folder
class_ref = class_reference_from_action_name(method_sym)
unless class_ref
alias_found = find_alias(method_sym.to_s)
if alias_found
@@ -128,11 +130,11 @@
# otherwise all NameErrors will be caught and the error message is
# confusing
if class_ref
if class_ref.respond_to?(:run)
# Action is available, now execute it
- return self.execute_action(method_sym, class_ref, arguments, custom_dir: custom_dir)
+ return self.execute_action(method_sym, class_ref, arguments, custom_dir: custom_dir, from_action: from_action)
else
UI.user_error!("Action '#{method_sym}' of class '#{class_name}' was found, but has no `run` method.")
end
else
# Action was not found
@@ -195,11 +197,11 @@
else
raise LaneNotAvailableError.new, "Lane not found"
end
end
- def execute_action(method_sym, class_ref, arguments, custom_dir: nil)
+ def execute_action(method_sym, class_ref, arguments, custom_dir: nil, from_action: false)
if custom_dir.nil?
custom_dir ||= "." if Helper.test?
custom_dir ||= ".."
end
@@ -207,10 +209,13 @@
verify_supported_os(method_sym, class_ref)
begin
Dir.chdir(custom_dir) do # go up from the fastlane folder, to the project folder
- Actions.execute_action(class_ref.step_text) do
+ # If another action is calling this action, we shouldn't show it in the summary
+ # (see https://github.com/fastlane/fastlane/issues/4546)
+ action_name = from_action ? nil : class_ref.step_text
+ Actions.execute_action(action_name) do
# arguments is an array by default, containing an hash with the actual parameters
# Since we usually just need the passed hash, we'll just use the first object if there is only one
if arguments.count == 0
arguments = ConfigurationHelper.parse(class_ref, {}) # no parameters => empty hash
elsif arguments.count == 1 and arguments.first.kind_of? Hash