action-ansible-playbook/post.js

29 lines
615 B
JavaScript
Raw Normal View History

2020-05-07 03:41:40 -06:00
const core = require('@actions/core')
const fs = require('fs')
function rm(file) {
core.info(`==> Deleting "${file}" file`)
fs.unlinkSync(file)
}
async function main() {
try {
const keyFile = core.getState("keyFile")
const inventoryFile = core.getState("inventoryFile")
const vaultPasswordFile = core.getState("vaultPasswordFile")
if (keyFile)
rm(keyFile)
if (inventoryFile)
rm(inventoryFile)
if (vaultPasswordFile)
rm(vaultPasswordFile)
} catch (error) {
core.setFailed(error.message)
}
}
main()