Skip to content

Commit

Permalink
Merge pull request #14 from dawidd6/check-file-exists
Browse files Browse the repository at this point in the history
Check if file exists before unlinking
  • Loading branch information
dawidd6 authored Dec 6, 2020
2 parents a90a5a2 + 81f2a15 commit d28d998
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,11 @@ jobs:
options: |
-e key1=val1
-e key2=val2
- name: Test local
uses: ./
with:
playbook: playbook.yml
vault_password: test
inventory: |
[all]
localhost ansible_connection=local
6 changes: 4 additions & 2 deletions post.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ const core = require('@actions/core')
const fs = require('fs')

function rm(file) {
core.info(`==> Deleting "${file}" file`)
fs.unlinkSync(file)
if (fs.existsSync(file)) {
core.info(`==> Deleting "${file}" file`)
fs.unlinkSync(file)
}
}

async function main() {
Expand Down

0 comments on commit d28d998

Please sign in to comment.