mirror of
https://github.com/actions/github-script.git
synced 2026-02-08 12:07:26 +00:00
Add default globals
This commit is contained in:
parent
88183f022f
commit
209c8fe2bb
2 changed files with 4 additions and 6 deletions
9
dist/index.js
generated
vendored
9
dist/index.js
generated
vendored
|
|
@ -1510,13 +1510,10 @@ function main() {
|
||||||
const github = new _actions_github__WEBPACK_IMPORTED_MODULE_1__.GitHub(token, opts);
|
const github = new _actions_github__WEBPACK_IMPORTED_MODULE_1__.GitHub(token, opts);
|
||||||
const script = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('script', { required: true });
|
const script = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('script', { required: true });
|
||||||
const fn = wrapFunction(script);
|
const fn = wrapFunction(script);
|
||||||
const result = yield vm__WEBPACK_IMPORTED_MODULE_2__.runInNewContext(fn, {
|
const result = yield vm__WEBPACK_IMPORTED_MODULE_2__.runInNewContext(fn, Object.assign({}, global, { github,
|
||||||
github,
|
|
||||||
console,
|
console,
|
||||||
context: _actions_github__WEBPACK_IMPORTED_MODULE_1__.context,
|
context: _actions_github__WEBPACK_IMPORTED_MODULE_1__.context, actions: { core: _actions_core__WEBPACK_IMPORTED_MODULE_0__ }, require: __webpack_require__(875) // Otherwise, the build step will compile this incorrectly.
|
||||||
actions: { core: _actions_core__WEBPACK_IMPORTED_MODULE_0__ },
|
}), {
|
||||||
require: __webpack_require__(875) // Otherwise, the build step will compile this incorrectly.
|
|
||||||
}, {
|
|
||||||
lineOffset: -1
|
lineOffset: -1
|
||||||
});
|
});
|
||||||
let encoding = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('result-encoding');
|
let encoding = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('result-encoding');
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ async function main() {
|
||||||
const result = await vm.runInNewContext(
|
const result = await vm.runInNewContext(
|
||||||
fn,
|
fn,
|
||||||
{
|
{
|
||||||
|
...global,
|
||||||
github,
|
github,
|
||||||
console,
|
console,
|
||||||
context,
|
context,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue