Skip to content

Commit 54af4c1

Browse files
yutopppeaceiris
andauthored
fix: Wrap an entrypoint by async to handle exceptions correctly (#363)
* fix: add return type Co-authored-by: Shohei Ueda <30958501+peaceiris@users.noreply.github.com>
1 parent 998d851 commit 54af4c1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/index.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import * as core from '@actions/core';
22
import * as main from './main';
33

4-
try {
5-
main.run();
6-
} catch (e) {
7-
core.setFailed(`Action failed with error ${e}`);
8-
}
4+
(async (): Promise<void> => {
5+
try {
6+
await main.run();
7+
} catch (e) {
8+
core.setFailed(`Action failed with error ${e.message}`);
9+
}
10+
})();

0 commit comments

Comments
 (0)