From 8fb0b06275474768ac5f28e6a314eb48700e8fce Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Sun, 9 Oct 2022 06:01:08 +0200 Subject: [PATCH] :wrench: Fix input parsing --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index a879755..8e15a02 100644 --- a/index.js +++ b/index.js @@ -153,14 +153,12 @@ try { content.cacheSeconds = parseInt(cacheSeconds); } - let shouldUpdate = true; - // For the POST request, the above content is set as file contents for the // given filename. const request = JSON.stringify({files: {[filename]: {content: JSON.stringify(content)}}}); - if (core.getInput('forceUpdate')) { + if (core.getBooleanInput('forceUpdate')) { updateGist(request); } else { const getGistOptions = { @@ -182,6 +180,8 @@ try { ', status message: ' + oldGist.statusMessage); } + let shouldUpdate = true; + if (oldGist && oldGist.body && oldGist.body.files && oldGist.body.files[filename]) { const oldContent = oldGist.body.files[filename].content;