split into setup and execute actions
This commit is contained in:
@@ -16,7 +16,7 @@ export async function run() {
|
||||
buildAgent.exportVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1");
|
||||
await gitVersionTool.install(version, includePrerelease);
|
||||
|
||||
buildAgent.setSucceeded("GitVersion executed successfully", true);
|
||||
buildAgent.setSucceeded("GitVersion installed successfully", true);
|
||||
} catch (error) {
|
||||
buildAgent.setFailed(error.message, true);
|
||||
}
|
||||
25
src/github/setup.ts
Normal file
25
src/github/setup.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import "reflect-metadata";
|
||||
|
||||
import { IBuildAgent, IGitVersionTool } from "../interfaces";
|
||||
import { TYPES } from "../types";
|
||||
import { ioc } from "./ioc";
|
||||
|
||||
const gitVersionTool = ioc.get<IGitVersionTool>(TYPES.IGitVersionTool);
|
||||
const buildAgent = ioc.get<IBuildAgent>(TYPES.IBuildAgent);
|
||||
|
||||
export async function run() {
|
||||
try {
|
||||
|
||||
const version = "5.1.2";
|
||||
const includePrerelease = false;
|
||||
|
||||
buildAgent.exportVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1");
|
||||
await gitVersionTool.install(version, includePrerelease);
|
||||
|
||||
buildAgent.setSucceeded("GitVersion installed successfully", true);
|
||||
} catch (error) {
|
||||
buildAgent.setFailed(error.message, true);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
Reference in New Issue
Block a user