Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0f28aef

Browse filesBrowse files
committed
Pass input options to GitHub constructor
1 parent 1aae562 commit 0f28aef
Copy full SHA for 0f28aef

File tree

1 file changed

+9
-2
lines changed
Filter options

1 file changed

+9
-2
lines changed

‎main.js

Copy file name to clipboardExpand all lines: main.js
+9-2Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@ main().catch(handleError)
66

77
async function main() {
88
const AsyncFunction = Object.getPrototypeOf(async () => {}).constructor
9-
const script = core.getInput('script', {required: true})
109
const token = core.getInput('github-token', {required: true})
10+
const debug = core.getInput('debug')
11+
const userAgent = core.getInput('user-agent')
12+
const previews = core.getInput('previews')
13+
const opts = {}
14+
if (debug) opts.log = console
15+
if (userAgent) opts.userAgent = userAgent
16+
if (previews) opts.previews = previews
17+
const client = new GitHub(token, opts)
18+
const script = core.getInput('script', {required: true})
1119
const fn = new AsyncFunction('github', 'context', script)
12-
const client = new GitHub(token)
1320
const result = await fn(client, context)
1421
core.setOutput('result', JSON.stringify(result))
1522
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.