Skip to content

Commit 6ca5690

Browse files
committed
Only create tag if commit was made
1 parent 38f43a9 commit 6ca5690

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

Tasks/UnityBuild/UnityBuildV3/unity-versioning.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -250,29 +250,29 @@ export class UnityVersioning {
250250
projectVersioningCommitChangesUserMailVariableName,
251251
true
252252
)!;
253-
}
254253

255-
const createTag = tl.getBoolInput(
256-
projectVersioningCreateTagVariableName,
257-
true
258-
)!;
259-
260-
// Since we pushed to the repository, does the user also want to create a tag?
261-
if (createTag) {
262-
const createTagPattern = tl.getInput(
263-
projectVersioningCreateTagPatternVariableName,
254+
const createTag = tl.getBoolInput(
255+
projectVersioningCreateTagVariableName,
264256
true
265257
)!;
266258

267-
gitTag = createTagPattern.replace(
268-
"{{bundleVersion}}",
269-
`${bundleVersion.major}.${bundleVersion.minor}.${bundleVersion.patch}`
270-
);
259+
// Since we pushed to the repository, does the user also want to create a tag?
260+
if (createTag) {
261+
const createTagPattern = tl.getInput(
262+
projectVersioningCreateTagPatternVariableName,
263+
true
264+
)!;
271265

272-
gitTag = createTagPattern.replace(
273-
"{{buildNumber}}",
274-
buildCode.toString()
275-
);
266+
gitTag = createTagPattern.replace(
267+
"{{bundleVersion}}",
268+
`${bundleVersion.major}.${bundleVersion.minor}.${bundleVersion.patch}`
269+
);
270+
271+
gitTag = createTagPattern.replace(
272+
"{{buildNumber}}",
273+
buildCode.toString()
274+
);
275+
}
276276
}
277277

278278
tl.setVariable(

0 commit comments

Comments
 (0)