You've already forked dynamic-badges-action
🔧 Fix input parsing
This commit is contained in:
6
index.js
6
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;
|
||||
|
||||
Reference in New Issue
Block a user