Skip to content

Commit

Permalink
main: save filenames in state
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidd6 committed May 7, 2020
1 parent 4f3ca9b commit 9fa54a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -26,20 +25,23 @@ 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)
}

if (inventory) {
const inventoryFile = ".ansible_inventory"
fs.writeFileSync(inventoryFile, inventory, { mode: 0600 })
core.saveState("inventoryFile", inventoryFile)
cmd.push("--inventory-file")
cmd.push(inventoryFile)
}

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)
}
Expand Down

0 comments on commit 9fa54a3

Please sign in to comment.