mirror of
https://github.com/actions/github-script.git
synced 2025-12-08 16:16:21 +00:00
Transform inputs from strings
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user