mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2024-11-22 15:32:18 +00:00
Merge pull request #14 from dawidd6/check-file-exists
Check if file exists before unlinking
This commit is contained in:
commit
d28d9989a8
2 changed files with 12 additions and 2 deletions
8
.github/workflows/test.yml
vendored
8
.github/workflows/test.yml
vendored
|
@ -67,3 +67,11 @@ jobs:
|
||||||
options: |
|
options: |
|
||||||
-e key1=val1
|
-e key1=val1
|
||||||
-e key2=val2
|
-e key2=val2
|
||||||
|
- name: Test local
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
playbook: playbook.yml
|
||||||
|
vault_password: test
|
||||||
|
inventory: |
|
||||||
|
[all]
|
||||||
|
localhost ansible_connection=local
|
||||||
|
|
2
post.js
2
post.js
|
@ -2,8 +2,10 @@ const core = require('@actions/core')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
|
|
||||||
function rm(file) {
|
function rm(file) {
|
||||||
|
if (fs.existsSync(file)) {
|
||||||
core.info(`==> Deleting "${file}" file`)
|
core.info(`==> Deleting "${file}" file`)
|
||||||
fs.unlinkSync(file)
|
fs.unlinkSync(file)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
|
Loading…
Reference in a new issue