@@ -6114,6 +6114,9 @@ var glob = __webpack_require__(90);
61146114// EXTERNAL MODULE: ./node_modules/@actions /io/lib/io.js
61156115var io = __webpack_require__ ( 436 ) ;
61166116
6117+ // EXTERNAL MODULE: external "path"
6118+ var external_path_ = __webpack_require__ ( 622 ) ;
6119+
61176120// CONCATENATED MODULE: ./src/async-function.ts
61186121const AsyncFunction = Object . getPrototypeOf ( async ( ) => null ) . constructor ;
61196122function callAsyncFunction ( args , source ) {
@@ -6127,6 +6130,7 @@ function callAsyncFunction(args, source) {
61276130
61286131
61296132
6133+
61306134process . on ( 'unhandledRejection' , handleError ) ;
61316135main ( ) . catch ( handleError ) ;
61326136async function main ( ) {
@@ -6144,7 +6148,14 @@ async function main() {
61446148 const github = Object ( lib_github . getOctokit ) ( token , opts ) ;
61456149 const script = Object ( core . getInput ) ( 'script' , { required : true } ) ;
61466150 // Using property/value shorthand on `require` (e.g. `{require}`) causes compilation errors.
6147- const result = await callAsyncFunction ( { require : require , github, context : lib_github . context , core : core , glob : glob , io : io } , script ) ;
6151+ const result = await callAsyncFunction ( {
6152+ require : wrapRequire ,
6153+ github,
6154+ context : lib_github . context ,
6155+ core : core ,
6156+ glob : glob ,
6157+ io : io
6158+ } , script ) ;
61486159 let encoding = Object ( core . getInput ) ( 'result-encoding' ) ;
61496160 encoding = encoding ? encoding : 'json' ;
61506161 let output ;
@@ -6160,6 +6171,17 @@ async function main() {
61606171 }
61616172 Object ( core . setOutput ) ( 'result' , output ) ;
61626173}
6174+ const wrapRequire = new Proxy ( require , {
6175+ apply : ( target , thisArg , [ moduleID ] ) => {
6176+ if ( moduleID . startsWith ( '.' ) ) {
6177+ moduleID = Object ( external_path_ . join ) ( process . cwd ( ) , moduleID ) ;
6178+ }
6179+ return target . apply ( thisArg , [ moduleID ] ) ;
6180+ } ,
6181+ get : ( target , prop , receiver ) => {
6182+ Reflect . get ( target , prop , receiver ) ;
6183+ }
6184+ } ) ;
61636185// eslint-disable-next-line @typescript-eslint/no-explicit-any
61646186function handleError ( err ) {
61656187 console . error ( err ) ;
0 commit comments