mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2025-09-03 15:25:46 -06:00
Merge branch 'master' into option-to-control-colored-output
This commit is contained in:
commit
126c42dd51
@ -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…
x
Reference in New Issue
Block a user