mirror of
https://github.com/actions/github-script.git
synced 2025-12-21 07:12:30 +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 github = Object(lib_github.getOctokit)(token, opts);
|
||||||
const script = Object(core.getInput)('script', { required: true });
|
const script = Object(core.getInput)('script', { required: true });
|
||||||
// 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({ 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');
|
let encoding = Object(core.getInput)('result-encoding');
|
||||||
encoding = encoding ? encoding : 'json';
|
encoding = encoding ? encoding : 'json';
|
||||||
let output;
|
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:
|
/***/ 877:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import {Context} from '@actions/github/lib/context'
|
import { Context } from '@actions/github/lib/context'
|
||||||
import {GitHub} from '@actions/github/lib/utils'
|
import { GitHub } from '@actions/github/lib/utils'
|
||||||
import * as glob from '@actions/glob'
|
import * as glob from '@actions/glob'
|
||||||
import * as io from '@actions/io'
|
import * as io from '@actions/io'
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import * as glob from '@actions/glob'
|
|||||||
import * as io from '@actions/io'
|
import * as io from '@actions/io'
|
||||||
import {callAsyncFunction} from './async-function'
|
import {callAsyncFunction} from './async-function'
|
||||||
|
|
||||||
|
declare const __non_webpack_require__: typeof require
|
||||||
|
|
||||||
process.on('unhandledRejection', handleError)
|
process.on('unhandledRejection', handleError)
|
||||||
main().catch(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.
|
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilation errors.
|
||||||
const result = await callAsyncFunction(
|
const result = await callAsyncFunction(
|
||||||
{require: require, github, context, core, glob, io},
|
{require: __non_webpack_require__, github, context, core, glob, io},
|
||||||
script
|
script
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user