Add default globals

This commit is contained in:
Jonathan Clem 2020-01-10 08:02:42 -05:00
parent 88183f022f
commit 209c8fe2bb
No known key found for this signature in database
GPG key ID: B3662C4A8F843179
2 changed files with 4 additions and 6 deletions

9
dist/index.js generated vendored
View file

@ -1510,13 +1510,10 @@ function main() {
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 fn = wrapFunction(script);
const result = yield vm__WEBPACK_IMPORTED_MODULE_2__.runInNewContext(fn, {
github,
const result = yield vm__WEBPACK_IMPORTED_MODULE_2__.runInNewContext(fn, Object.assign({}, global, { github,
console,
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.
}, {
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.
}), {
lineOffset: -1
});
let encoding = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('result-encoding');

View file

@ -21,6 +21,7 @@ async function main() {
const result = await vm.runInNewContext(
fn,
{
...global,
github,
console,
context,