mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2025-04-15 04:14:42 +00:00
Fixes boolean inputs
Boolean inputs weren't working properly before. Passing any value would result in `true`, which is unexpected and not according to inputs description. This change retrieves booleans with `getBooleanInput()` and sets a default to `false`. Relevant GitHub discussion and comment: https://github.com/actions/toolkit/issues/361#issuecomment-829507270
This commit is contained in:
parent
95b662c1c8
commit
8f3b59f211
2 changed files with 6 additions and 3 deletions
|
@ -34,12 +34,15 @@ inputs:
|
|||
sudo:
|
||||
description: Set to "true" if root is required for running your playbook
|
||||
required: false
|
||||
default: "false"
|
||||
no_color:
|
||||
description: Set to "true" if the Ansible output should not include colors (defaults to "false")
|
||||
required: false
|
||||
default: "false"
|
||||
check_mode:
|
||||
description: Set to "true" to enable check (dry-run) mode
|
||||
required: false
|
||||
default: "false"
|
||||
outputs:
|
||||
output:
|
||||
description: The captured output of both stdout and stderr from the Ansible Playbook run
|
||||
|
|
6
main.js
6
main.js
|
@ -15,9 +15,9 @@ async function main() {
|
|||
const vaultPassword = core.getInput("vault_password")
|
||||
const knownHosts = core.getInput("known_hosts")
|
||||
const options = core.getInput("options")
|
||||
const sudo = core.getInput("sudo")
|
||||
const noColor = core.getInput("no_color")
|
||||
const checkMode = core.getInput("check_mode")
|
||||
const sudo = core.getBooleanInput("sudo")
|
||||
const noColor = core.getBooleanInput("no_color")
|
||||
const checkMode = core.getBooleanInput("check_mode")
|
||||
const fileMode = 0600
|
||||
|
||||
let cmd = ["ansible-playbook", playbook]
|
||||
|
|
Loading…
Add table
Reference in a new issue