diff --git a/src/main.ts b/src/main.ts index 5d9055a..07b8e9a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,16 +2,24 @@ import core from '@actions/core'; import { lint } from './lint'; import { getActionConfig } from './utils/config'; -try { - const { - githubToken, - githubWorkspace, - rulesPath, - enforcedScopeTypes, - scopeRegex - } = getActionConfig(); +(async () => { + try { + const { + githubToken, + githubWorkspace, + rulesPath, + enforcedScopeTypes, + scopeRegex + } = getActionConfig(); - lint(githubToken, githubWorkspace, rulesPath, enforcedScopeTypes, scopeRegex); -} catch (e) { - core.setFailed(`Failed to run action with error: ${e}`); -} + await lint( + githubToken, + githubWorkspace, + rulesPath, + enforcedScopeTypes, + scopeRegex + ); + } catch (e) { + core.setFailed(`Failed to run action with error: ${e}`); + } +})();