mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2024-12-27 10:36:09 -07:00
main: save filenames in state
This commit is contained in:
parent
4f3ca9bf23
commit
9fa54a34c7
4
main.js
4
main.js
|
@ -2,7 +2,6 @@ const core = require('@actions/core')
|
|||
const exec = require('@actions/exec')
|
||||
const fs = require('fs')
|
||||
const os = require('os')
|
||||
const path = require('path')
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
|
@ -26,6 +25,7 @@ async function main() {
|
|||
if (key) {
|
||||
const keyFile = ".ansible_key"
|
||||
fs.writeFileSync(keyFile, key + os.EOL, { mode: 0600 })
|
||||
core.saveState("keyFile", keyFile)
|
||||
cmd.push("--key-file")
|
||||
cmd.push(keyFile)
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ async function main() {
|
|||
if (inventory) {
|
||||
const inventoryFile = ".ansible_inventory"
|
||||
fs.writeFileSync(inventoryFile, inventory, { mode: 0600 })
|
||||
core.saveState("inventoryFile", inventoryFile)
|
||||
cmd.push("--inventory-file")
|
||||
cmd.push(inventoryFile)
|
||||
}
|
||||
|
@ -40,6 +41,7 @@ async function main() {
|
|||
if (vaultPassword) {
|
||||
const vaultPasswordFile = ".ansible_vault_password"
|
||||
fs.writeFileSync(vaultPasswordFile, vaultPassword, { mode: 0600 })
|
||||
core.saveState("vaultPasswordFile", vaultPasswordFile)
|
||||
cmd.push("--vault-password-file")
|
||||
cmd.push(vaultPasswordFile)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user