fix: action failure status (#151)

Close #149

* chore: fix path to .gitconfig
This commit is contained in:
Shohei Ueda
2020-01-25 12:42:32 +09:00
committed by GitHub
parent de65f3e128
commit 94853340b9
3 changed files with 23 additions and 23 deletions

View File

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

View File

@@ -34,28 +34,23 @@ export async function showVersion(
}
export async function run(): Promise<ActionResult> {
try {
const toolVersion: string = core.getInput('hugo-version');
let installVersion = '';
const toolVersion: string = core.getInput('hugo-version');
let installVersion = '';
let result: ActionResult = {
exitcode: 0,
output: ''
};
let result: ActionResult = {
exitcode: 0,
output: ''
};
if (toolVersion === '' || toolVersion === 'latest') {
installVersion = await getLatestVersion(Tool.Org, Tool.Repo, 'brew');
} else {
installVersion = toolVersion;
}
core.info(`${Tool.Name} version: ${installVersion}`);
await installer(installVersion);
result = await showVersion(Tool.CmdName, [Tool.CmdOptVersion]);
return result;
} catch (e) {
core.setFailed(`Action failed with error ${e}`);
throw e;
if (toolVersion === '' || toolVersion === 'latest') {
installVersion = await getLatestVersion(Tool.Org, Tool.Repo, 'brew');
} else {
installVersion = toolVersion;
}
core.info(`${Tool.Name} version: ${installVersion}`);
await installer(installVersion);
result = await showVersion(Tool.CmdName, [Tool.CmdOptVersion]);
return result;
}