mirror of
https://github.com/actions/github-script.git
synced 2025-12-09 12:26:21 +00:00
Fix result-enoding/encoding typo
This commit is contained in:
10
dist/index.js
vendored
10
dist/index.js
vendored
@@ -416,23 +416,23 @@ async function main() {
|
|||||||
const fn = new AsyncFunction('require', 'github', 'context', script)
|
const fn = new AsyncFunction('require', 'github', 'context', script)
|
||||||
const result = await fn(require, client, context)
|
const result = await fn(require, client, context)
|
||||||
|
|
||||||
let encoding = core.getInput('result-enoding')
|
let encoding = core.getInput('result-encoding')
|
||||||
encoding = encoding != null ? encoding : 'json'
|
encoding = encoding ? encoding : 'json'
|
||||||
|
|
||||||
let output
|
let output
|
||||||
|
|
||||||
switch (encoding) {
|
switch (encoding) {
|
||||||
case 'json':
|
case 'json':
|
||||||
result = JSON.stringify(result)
|
output = JSON.stringify(result)
|
||||||
break
|
break
|
||||||
case 'string':
|
case 'string':
|
||||||
result = String(result)
|
output = String(result)
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
throw new Error('"result-encoding" must be either "string" or "json"')
|
throw new Error('"result-encoding" must be either "string" or "json"')
|
||||||
}
|
}
|
||||||
|
|
||||||
core.setOutput('result', result)
|
core.setOutput('result', output)
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleError(err) {
|
function handleError(err) {
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ async function main() {
|
|||||||
const fn = new AsyncFunction('require', 'github', 'context', script)
|
const fn = new AsyncFunction('require', 'github', 'context', script)
|
||||||
const result = await fn(require, client, context)
|
const result = await fn(require, client, context)
|
||||||
|
|
||||||
let encoding = core.getInput('result-enoding')
|
let encoding = core.getInput('result-encoding')
|
||||||
encoding = encoding != null ? encoding : 'json'
|
encoding = encoding ? encoding : 'json'
|
||||||
|
|
||||||
let output
|
let output
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user