mirror of
https://github.com/actions/github-script.git
synced 2026-04-07 14:49:25 +00:00
Use non-Webpack-require in evaluated scripts
This commit is contained in:
parent
59cb74c2ee
commit
ddba1b195d
3 changed files with 6 additions and 23 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import * as core from '@actions/core'
|
||||
import {Context} from '@actions/github/lib/context'
|
||||
import {GitHub} from '@actions/github/lib/utils'
|
||||
import { Context } from '@actions/github/lib/context'
|
||||
import { GitHub } from '@actions/github/lib/utils'
|
||||
import * as glob from '@actions/glob'
|
||||
import * as io from '@actions/io'
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import * as glob from '@actions/glob'
|
|||
import * as io from '@actions/io'
|
||||
import {callAsyncFunction} from './async-function'
|
||||
|
||||
declare const __non_webpack_require__: typeof require
|
||||
|
||||
process.on('unhandledRejection', handleError)
|
||||
main().catch(handleError)
|
||||
|
||||
|
|
@ -29,7 +31,7 @@ async function main(): Promise<void> {
|
|||
|
||||
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilation errors.
|
||||
const result = await callAsyncFunction(
|
||||
{require: require, github, context, core, glob, io},
|
||||
{require: __non_webpack_require__, github, context, core, glob, io},
|
||||
script
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue