mirror of
https://github.com/actions/github-script.git
synced 2026-02-08 03:57:27 +00:00
Transform inputs from strings
This commit is contained in:
parent
e6944039f8
commit
fbe453a850
2 changed files with 4 additions and 4 deletions
|
|
@ -17,7 +17,7 @@ inputs:
|
||||||
description: An optional user-agent string
|
description: An optional user-agent string
|
||||||
default: actions/github-script
|
default: actions/github-script
|
||||||
previews:
|
previews:
|
||||||
description: A list of API previews to accept
|
description: A comma-separated list of API previews to accept
|
||||||
outputs:
|
outputs:
|
||||||
result:
|
result:
|
||||||
description: The return value of the script, stringified with `JSON.stringify`
|
description: The return value of the script, stringified with `JSON.stringify`
|
||||||
|
|
|
||||||
6
main.js
6
main.js
|
|
@ -11,9 +11,9 @@ async function main() {
|
||||||
const userAgent = core.getInput('user-agent')
|
const userAgent = core.getInput('user-agent')
|
||||||
const previews = core.getInput('previews')
|
const previews = core.getInput('previews')
|
||||||
const opts = {}
|
const opts = {}
|
||||||
if (debug) opts.log = console
|
if (debug === 'true') opts.log = console
|
||||||
if (userAgent) opts.userAgent = userAgent
|
if (userAgent != null) opts.userAgent = userAgent
|
||||||
if (previews) opts.previews = previews
|
if (previews != null) opts.previews = previews.split(',')
|
||||||
const client = new GitHub(token, opts)
|
const client = new GitHub(token, opts)
|
||||||
const script = core.getInput('script', {required: true})
|
const script = core.getInput('script', {required: true})
|
||||||
const fn = new AsyncFunction('github', 'context', script)
|
const fn = new AsyncFunction('github', 'context', script)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue