Fix result-enoding/encoding typo

This commit is contained in:
Jonathan Clem
2020-01-08 14:43:44 -05:00
parent 9abe67e516
commit 99889c25e0
2 changed files with 7 additions and 7 deletions

10
dist/index.js vendored
View File

@@ -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) {