From 7e6cacac838d3c6b3e59fcc04c25878cd29e1269 Mon Sep 17 00:00:00 2001 From: Brooks Swinnerton Date: Fri, 30 Jul 2021 21:47:20 -0400 Subject: [PATCH] Append stdout and stderr to string, then log --- main.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 39ffb0c..8dec1ee 100644 --- a/main.js +++ b/main.js @@ -81,17 +81,21 @@ async function main() { process.env.ANSIBLE_FORCE_COLOR = "True" + let stdout = '' + let stderr = '' const execOptions = {} execOptions.listeners = { stdout: function(data) { - core.setOutput('stdout', data.toString()); + stdout += data.toString() }, stderr: function(data) { - core.setOutput('stderr', data.toString()); + stderr += data.toString() } } await exec.exec("ansible-playbook", cmd, execOptions) + core.setOutput('stdout', stdout) + core.setOutput('stderr', stderr) } catch (error) { core.setFailed(error.message) }