8000 add core access, allow specifying script-path · Khan/github-script@3f3ec32 · GitHub
[go: up one dir, main page]

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
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 3f3ec32

Browse files
authored
add core access, allow specifying script-path
1 parent 4768300 commit 3f3ec32

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

main.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ async function main() {
1515
if (userAgent != null) opts.userAgent = userAgent
1616
if (previews != null) opts.previews = previews.split(',')
1717
const client = new GitHub(token, opts)
18-
const script = core.getInput('script', {required: true})
19-
const fn = new AsyncFunction('github', 'context', script)
20-
const result = await fn(client, context)
18+
let script = core.getInput('script')
19+
const script_path = core.getInput('script-path')
20+
if (script_path) {
21+
script = require('fs').readFileSync(script_path);
22+
}
23+
const fn = new AsyncFunction('github', 'context', 'core', script)
24+
const result = await fn(client, context, core)
2125
core.setOutput('result', JSON.stringify(result))
2226
}
2327

0 commit comments

Comments
 (0)
0