From 0d19991235fbfcc105f6bd13673665bce06005de Mon Sep 17 00:00:00 2001 From: Shohei Ueda <30958501+peaceiris@users.noreply.github.com> Date: Mon, 22 Jun 2020 01:59:58 +0900 Subject: [PATCH] fix: Wrap entrypoint by async to handle exceptions correctly (#246) --- src/index.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index e2a31b4..24a628b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,10 @@ -import {run} from './main'; +import * as core from '@actions/core'; +import * as main from './main'; -run(); +(async (): Promise => { + try { + await main.run(); + } catch (e) { + core.setFailed(`Action failed with error ${e.message}`); + } +})();