diff --git a/action.yml b/action.yml index 0309b40..495185e 100644 --- a/action.yml +++ b/action.yml @@ -34,6 +34,9 @@ inputs: no_color: description: Set to "true" if the Ansible output should not include colors (defaults to "false") required: false +outputs: + output: + description: The captured output of both stdout and stderr from the Ansible Playbook run runs: using: node12 main: main.js diff --git a/main.js b/main.js index f94868e..2e4a365 100644 --- a/main.js +++ b/main.js @@ -86,7 +86,18 @@ async function main() { process.env.ANSIBLE_FORCE_COLOR = "True" } - await exec.exec(cmd.join(' ')) + let output = "" + await exec.exec(cmd.join(' '), null, { + listeners: { + stdout: function(data) { + output += data.toString() + }, + stderr: function(data) { + output += data.toString() + } + } + }) + core.setOutput("output", output) } catch (error) { core.setFailed(error.message) }