fix: Wrap an entrypoint by async to handle exceptions correctly

This commit is contained in:
yutopp 2020-06-21 05:54:16 +09:00 committed by peaceiris
parent 998d85162e
commit b4d9c85eba
No known key found for this signature in database
GPG key ID: 5868468A8EBA64EC

View file

@ -1,8 +1,10 @@
import * as core from '@actions/core'; import * as core from '@actions/core';
import * as main from './main'; import * as main from './main';
(async () => {
try { try {
main.run(); await main.run();
} catch (e) { } catch (e) {
core.setFailed(`Action failed with error ${e}`); core.setFailed(`Action failed with error ${e}`);
} }
})();