mirror of
https://github.com/actions/github-script.git
synced 2025-12-08 08:06:23 +00:00
Pass nativeRequire, as well
This commit is contained in:
1
dist/index.js
vendored
1
dist/index.js
vendored
@@ -2494,6 +2494,7 @@ async function main() {
|
||||
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilation errors.
|
||||
const result = await callAsyncFunction({
|
||||
require: wrapRequire,
|
||||
nativeRequire: require,
|
||||
github,
|
||||
context: lib_github.context,
|
||||
core: core,
|
||||
|
||||
@@ -13,6 +13,7 @@ type AsyncFunctionArguments = {
|
||||
glob: typeof glob
|
||||
io: typeof io
|
||||
require: NodeRequire
|
||||
nativeRequire: NodeRequire
|
||||
}
|
||||
|
||||
export function callAsyncFunction<T>(
|
||||
|
||||
@@ -32,6 +32,7 @@ async function main(): Promise<void> {
|
||||
const result = await callAsyncFunction(
|
||||
{
|
||||
require: wrapRequire,
|
||||
nativeRequire: __non_webpack_require__,
|
||||
github,
|
||||
context,
|
||||
core,
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import * as path from 'path'
|
||||
|
||||
declare const __non_webpack_require__: NodeRequire
|
||||
|
||||
export const wrapRequire = new Proxy(__non_webpack_require__, {
|
||||
apply: (target, thisArg, [moduleID]) => {
|
||||
if (moduleID.startsWith('.')) {
|
||||
|
||||
1
types/non-webpack-require.ts
Normal file
1
types/non-webpack-require.ts
Normal file
@@ -0,0 +1 @@
|
||||
declare const __non_webpack_require__: NodeRequire
|
||||
Reference in New Issue
Block a user