mirror of
https://github.com/actions/github-script.git
synced 2025-12-21 07:12:30 +00:00
Remove async from callAsyncFunction
This commit is contained in:
3
dist/index.js
vendored
3
dist/index.js
vendored
@@ -9152,7 +9152,7 @@ var lib_github = __webpack_require__(469);
|
|||||||
|
|
||||||
// CONCATENATED MODULE: ./src/async-function.ts
|
// CONCATENATED MODULE: ./src/async-function.ts
|
||||||
const AsyncFunction = Object.getPrototypeOf(async () => { }).constructor;
|
const AsyncFunction = Object.getPrototypeOf(async () => { }).constructor;
|
||||||
async function callAsyncFunction(args, source) {
|
function callAsyncFunction(args, source) {
|
||||||
const fn = new AsyncFunction(...Object.keys(args), source);
|
const fn = new AsyncFunction(...Object.keys(args), source);
|
||||||
return fn(...Object.values(args));
|
return fn(...Object.values(args));
|
||||||
}
|
}
|
||||||
@@ -9179,7 +9179,6 @@ async function main() {
|
|||||||
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 compilatin errors.
|
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilatin errors.
|
||||||
const result = await callAsyncFunction({ require: __webpack_require__(875), github, context: lib_github.context }, script);
|
const result = await callAsyncFunction({ require: __webpack_require__(875), github, context: lib_github.context }, script);
|
||||||
console.log('test result', result);
|
|
||||||
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;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ const AsyncFunction = Object.getPrototypeOf(async () => {}).constructor
|
|||||||
|
|
||||||
type AsyncFunctionArguments = {[key: string]: any}
|
type AsyncFunctionArguments = {[key: string]: any}
|
||||||
|
|
||||||
export async function callAsyncFunction(
|
export function callAsyncFunction(
|
||||||
args: AsyncFunctionArguments,
|
args: AsyncFunctionArguments,
|
||||||
source: string
|
source: string
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ async function main() {
|
|||||||
script
|
script
|
||||||
)
|
)
|
||||||
|
|
||||||
console.log('test result', result)
|
|
||||||
|
|
||||||
let encoding = core.getInput('result-encoding')
|
let encoding = core.getInput('result-encoding')
|
||||||
encoding = encoding ? encoding : 'json'
|
encoding = encoding ? encoding : 'json'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user