From b395ad434f18158849e90238422ed6a499687c67 Mon Sep 17 00:00:00 2001 From: xrkffgg Date: Fri, 13 Aug 2021 12:58:11 +0800 Subject: [PATCH] fix: action run async (#79) * fix: for await * style: perf mess Co-authored-by: meteorlxy --- src/main.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.js b/src/main.js index 5e8da64..b6b5531 100644 --- a/src/main.js +++ b/src/main.js @@ -90,15 +90,15 @@ async function main() { const actions = core.getInput('actions', { required: true }); const actionsArr = actions.split(','); - actionsArr.forEach(item => { - testActions(item.trim()); - }); + for (const action of actionsArr) { + await testActions(action.trim()); + } - function testActions(action) { + async function testActions(action) { if (ALLACTIONS.includes(action)) { - choseActions(action); + await choseActions(action); } else { - core.setFailed('This actions not supported!'); + core.setFailed(`Actions: [${action}] is not supported!`); } }