working on output

This commit is contained in:
Artur Stolear
2019-11-22 18:18:42 +02:00
parent 1ebbaf4414
commit 31561bfe18
7 changed files with 62 additions and 34 deletions

View File

@@ -105,6 +105,10 @@ public Stats;
return this.getVariable("GITHUB_WORKSPACE");
}
public setOutput(name: string, value: string): void {
core.setOutput(name, value);
}
public getInput(input: string, required?: boolean): string {
return core.getInput(input, { required } as core.InputOptions);
}

View File

@@ -11,9 +11,15 @@ export async function run() {
try {
const inputOptions: IGitVersionOptions = getGitVersionOptions();
await gitVersionTool.run(inputOptions);
const result = await gitVersionTool.run(inputOptions);
console.log(result.stdout);
if (result.code === 0) {
buildAgent.setSucceeded("GitVersion executed successfully", true);
} else {
buildAgent.setFailed(result.error.message, true);
}
buildAgent.setSucceeded("GitVersion installed successfully", true);
} catch (error) {
buildAgent.setFailed(error, true);
}