generated from actions/container-action
-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathpost.js
43 lines (33 loc) · 1.04 KB
/
post.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const core = require('@actions/core')
const fs = require('fs')
function rm(file) {
if (fs.existsSync(file)) {
core.info(`Deleting "${file}" file`)
fs.unlinkSync(file)
}
}
async function main() {
try {
const directory = core.getState("directory")
const ansibleConfigurationFile = core.getState("ansibleConfigurationFile")
const keyFile = core.getState("keyFile")
const inventoryFile = core.getState("inventoryFile")
const vaultPasswordFile = core.getState("vaultPasswordFile")
const knownHostsFile = core.getState("knownHostsFile")
if (directory)
process.chdir(directory)
if (ansibleConfigurationFile)
rm(ansibleConfigurationFile)
if (keyFile)
rm(keyFile)
if (inventoryFile)
rm(inventoryFile)
if (vaultPasswordFile)
rm(vaultPasswordFile)
if (knownHostsFile)
rm(knownHostsFile)
} catch (error) {
core.setFailed(error.message)
}
}
main()