mirror of
https://github.com/actions/github-script.git
synced 2025-12-09 00:26:20 +00:00
Use non-Webpack-require in evaluated scripts
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user