fix: Wrap an entrypoint by async to handle exceptions correctly
This commit is contained in:
parent
998d85162e
commit
b4d9c85eba
1 changed files with 7 additions and 5 deletions
12
src/index.ts
12
src/index.ts
|
|
@ -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';
|
||||||
|
|
||||||
try {
|
(async () => {
|
||||||
main.run();
|
try {
|
||||||
} catch (e) {
|
await main.run();
|
||||||
core.setFailed(`Action failed with error ${e}`);
|
} catch (e) {
|
||||||
}
|
core.setFailed(`Action failed with error ${e}`);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue