From 40f4e8ca6be24f15d983ea2962510145a58a3d03 Mon Sep 17 00:00:00 2001 From: Fabiano Soares Honorato Date: Sat, 18 Feb 2023 11:26:33 -0300 Subject: [PATCH] fix: workflow output not sending output (#3091) --- server/core/runtime/post_workflow_hook_runner.go | 3 ++- server/core/runtime/pre_workflow_hook_runner.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/core/runtime/post_workflow_hook_runner.go b/server/core/runtime/post_workflow_hook_runner.go index 3125060c5..8f286ac94 100644 --- a/server/core/runtime/post_workflow_hook_runner.go +++ b/server/core/runtime/post_workflow_hook_runner.go @@ -70,7 +70,8 @@ func (wh DefaultPostWorkflowHookRunner) Run(ctx models.WorkflowHookCommandContex } } - wh.OutputHandler.SendWorkflowHook(ctx, fmt.Sprintf("%s\n", string(out)), true) + wh.OutputHandler.SendWorkflowHook(ctx, string(out), false) + wh.OutputHandler.SendWorkflowHook(ctx, "\n", true) ctx.Log.Info("successfully ran %q in %q", command, path) return string(out), strings.Trim(string(customStatusOut), "\n"), nil diff --git a/server/core/runtime/pre_workflow_hook_runner.go b/server/core/runtime/pre_workflow_hook_runner.go index 620ae91bc..622ed81ff 100644 --- a/server/core/runtime/pre_workflow_hook_runner.go +++ b/server/core/runtime/pre_workflow_hook_runner.go @@ -70,7 +70,8 @@ func (wh DefaultPreWorkflowHookRunner) Run(ctx models.WorkflowHookCommandContext } } - wh.OutputHandler.SendWorkflowHook(ctx, fmt.Sprintf("%s\n", string(out)), true) + wh.OutputHandler.SendWorkflowHook(ctx, string(out), false) + wh.OutputHandler.SendWorkflowHook(ctx, "\n", true) ctx.Log.Info("successfully ran %q in %q", command, path) return string(out), strings.Trim(string(customStatusOut), "\n"), nil