🔧 Fix input parsing

This commit is contained in:
Simon Schneegans
2022-10-09 06:01:08 +02:00
parent df67159685
commit 8fb0b06275

View File

@@ -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;