mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2025-04-22 15:53:36 +00:00
Merge branch 'master' into option-to-control-colored-output
This commit is contained in:
commit
126c42dd51
2 changed files with 15 additions and 1 deletions
|
@ -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
|
||||
|
|
13
main.js
13
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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue