Skip to content

Commit

Permalink
fix: Wrap entrypoint by async to handle exceptions correctly (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris authored Jun 21, 2020
1 parent 0a266e2 commit 0d19991
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import {run} from './main';
import * as core from '@actions/core';
import * as main from './main';

run();
(async (): Promise<void> => {
try {
await main.run();
} catch (e) {
core.setFailed(`Action failed with error ${e.message}`);
}
})();

0 comments on commit 0d19991

Please sign in to comment.