mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2024-12-28 11:06:09 -07:00
add post script
This commit is contained in:
parent
9fa54a34c7
commit
6249522d7c
28
post.js
Normal file
28
post.js
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
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()
|
Loading…
Reference in New Issue
Block a user