From 145a90075859c8242f239db45fa9a2ed6f8e37e4 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Sun, 6 Dec 2020 16:54:32 +0100 Subject: [PATCH 1/2] workflows: test running the action twice --- .github/workflows/test.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 545a183..13075a2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 From 81f2a1577801008c9af2183e2e42d036e822e1cb Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Sun, 6 Dec 2020 16:54:45 +0100 Subject: [PATCH 2/2] post: check if file exists before unlinking --- post.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/post.js b/post.js index b5441ba..0c149e2 100644 --- a/post.js +++ b/post.js @@ -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() {