mirror of
https://github.com/actions/github-script.git
synced 2025-12-08 08:06:23 +00:00
Transform inputs from strings
This commit is contained in:
@@ -17,7 +17,7 @@ inputs:
|
||||
description: An optional user-agent string
|
||||
default: actions/github-script
|
||||
previews:
|
||||
description: A list of API previews to accept
|
||||
description: A comma-separated list of API previews to accept
|
||||
outputs:
|
||||
result:
|
||||
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 previews = core.getInput('previews')
|
||||
const opts = {}
|
||||
if (debug) opts.log = console
|
||||
if (userAgent) opts.userAgent = userAgent
|
||||
if (previews) opts.previews = previews
|
||||
if (debug === 'true') opts.log = console
|
||||
if (userAgent != null) opts.userAgent = userAgent
|
||||
if (previews != null) opts.previews = previews.split(',')
|
||||
const client = new GitHub(token, opts)
|
||||
const script = core.getInput('script', {required: true})
|
||||
const fn = new AsyncFunction('github', 'context', script)
|
||||
|
||||
Reference in New Issue
Block a user