Skip to content

Commit 3a81688

Browse files
committed
Add git operations
1 parent 6ca5690 commit 3a81688

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Tasks/UnityBuild/UnityBuildV3/unity-versioning.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,11 @@ export class UnityVersioning {
256256
true
257257
)!;
258258

259+
tl.execSync("git", ["config", "user.name", commitChangesUserName]);
260+
tl.execSync("git", ["config", "user.email", commitChangesUserMail]);
261+
tl.execSync("git", ["add", "."]);
262+
tl.execSync("git", ["commit", "-m Azure Pipelines Build"]);
263+
259264
// Since we pushed to the repository, does the user also want to create a tag?
260265
if (createTag) {
261266
const createTagPattern = tl.getInput(
@@ -272,6 +277,13 @@ export class UnityVersioning {
272277
"{{buildNumber}}",
273278
buildCode.toString()
274279
);
280+
281+
tl.execSync("git", ["tag", gitTag]);
282+
}
283+
284+
tl.execSync("git", ["push", "origin HEAD"]);
285+
if (createTag) {
286+
tl.execSync("git", ["push", "origin", gitTag]);
275287
}
276288
}
277289

0 commit comments

Comments
 (0)