From 6249522d7c9b6e8b7db3028df4cda46255b52707 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Thu, 7 May 2020 11:41:40 +0200 Subject: [PATCH] add post script --- post.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 post.js diff --git a/post.js b/post.js new file mode 100644 index 0000000..400221d --- /dev/null +++ b/post.js @@ -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()