mirror of
https://github.com/peaceiris/actions-hugo.git
synced 2026-01-24 20:12:15 +01:00
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>
This commit is contained in:
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 (): Promise<void> => {
|
||||||
main.run();
|
try {
|
||||||
} catch (e) {
|
await main.run();
|
||||||
core.setFailed(`Action failed with error ${e}`);
|
} catch (e) {
|
||||||
}
|
core.setFailed(`Action failed with error ${e.message}`);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|||||||
Reference in New Issue
Block a user