fix: action failure status

This commit is contained in:
peaceiris 2020-01-25 03:33:09 +00:00
parent de65f3e128
commit 63d1ce5ec8
2 changed files with 22 additions and 22 deletions

View file

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

View file

@ -34,7 +34,6 @@ export async function showVersion(
} }
export async function run(): Promise<ActionResult> { export async function run(): Promise<ActionResult> {
try {
const toolVersion: string = core.getInput('hugo-version'); const toolVersion: string = core.getInput('hugo-version');
let installVersion = ''; let installVersion = '';
@ -54,8 +53,4 @@ export async function run(): Promise<ActionResult> {
result = await showVersion(Tool.CmdName, [Tool.CmdOptVersion]); result = await showVersion(Tool.CmdName, [Tool.CmdOptVersion]);
return result; return result;
} catch (e) {
core.setFailed(`Action failed with error ${e}`);
throw e;
}
} }