diff --git a/dist/index.js b/dist/index.js index 55f9d0b..2e00e1a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -416,23 +416,23 @@ async function main() { const fn = new AsyncFunction('require', 'github', 'context', script) const result = await fn(require, client, context) - let encoding = core.getInput('result-enoding') - encoding = encoding != null ? encoding : 'json' + let encoding = core.getInput('result-encoding') + encoding = encoding ? encoding : 'json' let output switch (encoding) { case 'json': - result = JSON.stringify(result) + output = JSON.stringify(result) break case 'string': - result = String(result) + output = String(result) break default: throw new Error('"result-encoding" must be either "string" or "json"') } - core.setOutput('result', result) + core.setOutput('result', output) } function handleError(err) { diff --git a/src/main.js b/src/main.js index d1c8ec1..96debee 100644 --- a/src/main.js +++ b/src/main.js @@ -19,8 +19,8 @@ async function main() { const fn = new AsyncFunction('require', 'github', 'context', script) const result = await fn(require, client, context) - let encoding = core.getInput('result-enoding') - encoding = encoding != null ? encoding : 'json' + let encoding = core.getInput('result-encoding') + encoding = encoding ? encoding : 'json' let output