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:
parent
e8ab09a21f
commit
7e6cacac83
1 changed files with 6 additions and 2 deletions
8
main.js
8
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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue