mirror of
https://github.com/actions/github-script.git
synced 2025-12-09 00:26:20 +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.
|
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilation errors.
|
||||||
const result = await callAsyncFunction({
|
const result = await callAsyncFunction({
|
||||||
require: wrapRequire,
|
require: wrapRequire,
|
||||||
|
nativeRequire: require,
|
||||||
github,
|
github,
|
||||||
context: lib_github.context,
|
context: lib_github.context,
|
||||||
core: core,
|
core: core,
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ type AsyncFunctionArguments = {
|
|||||||
glob: typeof glob
|
glob: typeof glob
|
||||||
io: typeof io
|
io: typeof io
|
||||||
require: NodeRequire
|
require: NodeRequire
|
||||||
|
nativeRequire: NodeRequire
|
||||||
}
|
}
|
||||||
|
|
||||||
export function callAsyncFunction<T>(
|
export function callAsyncFunction<T>(
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ async function main(): Promise<void> {
|
|||||||
const result = await callAsyncFunction(
|
const result = await callAsyncFunction(
|
||||||
{
|
{
|
||||||
require: wrapRequire,
|
require: wrapRequire,
|
||||||
|
nativeRequire: __non_webpack_require__,
|
||||||
github,
|
github,
|
||||||
context,
|
context,
|
||||||
core,
|
core,
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
|
|
||||||
declare const __non_webpack_require__: NodeRequire
|
|
||||||
|
|
||||||
export const wrapRequire = new Proxy(__non_webpack_require__, {
|
export const wrapRequire = new Proxy(__non_webpack_require__, {
|
||||||
apply: (target, thisArg, [moduleID]) => {
|
apply: (target, thisArg, [moduleID]) => {
|
||||||
if (moduleID.startsWith('.')) {
|
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