Skip to content

Commit d28d998

Browse files
authored
Merge pull request #14 from dawidd6/check-file-exists
Check if file exists before unlinking
2 parents a90a5a2 + 81f2a15 commit d28d998

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/workflows/test.yml

+8
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,11 @@ jobs:
6767
options: |
6868
-e key1=val1
6969
-e key2=val2
70+
- name: Test local
71+
uses: ./
72+
with:
73+
playbook: playbook.yml
74+
vault_password: test
75+
inventory: |
76+
[all]
77+
localhost ansible_connection=local

post.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ const core = require('@actions/core')
22
const fs = require('fs')
33

44
function rm(file) {
5-
core.info(`==> Deleting "${file}" file`)
6-
fs.unlinkSync(file)
5+
if (fs.existsSync(file)) {
6+
core.info(`==> Deleting "${file}" file`)
7+
fs.unlinkSync(file)
8+
}
79
}
810

911
async function main() {

0 commit comments

Comments
 (0)