mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2025-09-05 08:25:46 -06:00
Append stdout and stderr to string, then log
This commit is contained in:
parent
e8ab09a21f
commit
7e6cacac83
8
main.js
8
main.js
@ -81,17 +81,21 @@ async function main() {
|
|||||||
|
|
||||||
process.env.ANSIBLE_FORCE_COLOR = "True"
|
process.env.ANSIBLE_FORCE_COLOR = "True"
|
||||||
|
|
||||||
|
let stdout = ''
|
||||||
|
let stderr = ''
|
||||||
const execOptions = {}
|
const execOptions = {}
|
||||||
execOptions.listeners = {
|
execOptions.listeners = {
|
||||||
stdout: function(data) {
|
stdout: function(data) {
|
||||||
core.setOutput('stdout', data.toString());
|
stdout += data.toString()
|
||||||
},
|
},
|
||||||
stderr: function(data) {
|
stderr: function(data) {
|
||||||
core.setOutput('stderr', data.toString());
|
stderr += data.toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await exec.exec("ansible-playbook", cmd, execOptions)
|
await exec.exec("ansible-playbook", cmd, execOptions)
|
||||||
|
core.setOutput('stdout', stdout)
|
||||||
|
core.setOutput('stderr', stderr)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message)
|
core.setFailed(error.message)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user