diff --git a/lib/fastlane/plugin/ddg_apple_automation/actions/asana_log_message_action.rb b/lib/fastlane/plugin/ddg_apple_automation/actions/asana_log_message_action.rb index d0975d3..98fb98a 100644 --- a/lib/fastlane/plugin/ddg_apple_automation/actions/asana_log_message_action.rb +++ b/lib/fastlane/plugin/ddg_apple_automation/actions/asana_log_message_action.rb @@ -15,10 +15,10 @@ def self.run(params) comment = params[:comment] is_scheduled_release = params[:is_scheduled_release] github_handle = params[:github_handle] - args = params[:template_args] + args = (params[:template_args] || {}).merge(Hash(ENV).transform_keys { |key| key.downcase.gsub('-', '_') }) automation_task_id = Helper::AsanaHelper.get_release_automation_subtask_id(task_url, token) - params[:automation_task_id] = automation_task_id + args[:automation_task_id] = automation_task_id if is_scheduled_release task_id = Helper::AsanaHelper.extract_asana_task_id(task_url) diff --git a/spec/asana_create_action_item_action_spec.rb b/spec/asana_create_action_item_action_spec.rb index 11d9b68..536585d 100644 --- a/spec/asana_create_action_item_action_spec.rb +++ b/spec/asana_create_action_item_action_spec.rb @@ -17,7 +17,7 @@ allow(Fastlane::Helper::AsanaHelper).to receive(:extract_asana_task_assignee).and_return(assignee_id) allow(Fastlane::Helper::AsanaHelper).to receive(:get_release_automation_subtask_id).with(task_url, anything).and_return(automation_subtask_id) allow(Fastlane::Actions::AsanaCreateActionItemAction).to receive(:fetch_assignee_id).and_return(assignee_id) - allow(@asana_client_tasks).to receive(:create_subtask_for_task) + allow(@asana_client_tasks).to receive(:create_subtask_for_task).and_return(double('subtask', gid: "42")) allow(Fastlane::Helper::GitHubActionsHelper).to receive(:set_output) end diff --git a/spec/asana_log_message_action_spec.rb b/spec/asana_log_message_action_spec.rb index e0e4f49..b803c2e 100644 --- a/spec/asana_log_message_action_spec.rb +++ b/spec/asana_log_message_action_spec.rb @@ -54,7 +54,7 @@ task_id: automation_subtask_id, comment: comment, template_name: nil, - template_args: nil, + template_args: anything, asana_access_token: anything ) test_action(task_url: task_url, comment: comment, is_scheduled_release: false, github_handle: github_handle)