mirror of
https://github.com/actions/github-script.git
synced 2025-12-08 08:06:23 +00:00
Use non-Webpack-require in evaluated scripts
This commit is contained in:
21
dist/index.js
vendored
21
dist/index.js
vendored
@@ -6144,7 +6144,7 @@ async function main() {
|
||||
const github = Object(lib_github.getOctokit)(token, opts);
|
||||
const script = Object(core.getInput)('script', { required: true });
|
||||
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilation errors.
|
||||
const result = await callAsyncFunction({ require: __webpack_require__(875), github, context: lib_github.context, core: core, glob: glob, io: io }, script);
|
||||
const result = await callAsyncFunction({ require: require, github, context: lib_github.context, core: core, glob: glob, io: io }, script);
|
||||
let encoding = Object(core.getInput)('result-encoding');
|
||||
encoding = encoding ? encoding : 'json';
|
||||
let output;
|
||||
@@ -6901,25 +6901,6 @@ function expand(str, isTop) {
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 875:
|
||||
/***/ (function(module) {
|
||||
|
||||
function webpackEmptyContext(req) {
|
||||
if (typeof req === 'number' && __webpack_require__.m[req])
|
||||
return __webpack_require__(req);
|
||||
try { return require(req) }
|
||||
catch (e) { if (e.code !== 'MODULE_NOT_FOUND') throw e }
|
||||
var e = new Error("Cannot find module '" + req + "'");
|
||||
e.code = 'MODULE_NOT_FOUND';
|
||||
throw e;
|
||||
}
|
||||
webpackEmptyContext.keys = function() { return []; };
|
||||
webpackEmptyContext.resolve = webpackEmptyContext;
|
||||
module.exports = webpackEmptyContext;
|
||||
webpackEmptyContext.id = 875;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 877:
|
||||
|
||||
@@ -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