1
0
Fork 0
mirror of https://github.com/dawidd6/action-ansible-playbook.git synced 2025-04-21 23:33:35 +00:00

Append stdout and stderr to string, then log

This commit is contained in:
Brooks Swinnerton 2021-07-30 21:47:20 -04:00
parent e8ab09a21f
commit 7e6cacac83
No known key found for this signature in database
GPG key ID: 72743B7DE552E25A

View file

@ -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)
}