@@ -170,6 +170,8 @@ private static void MainInner(string? task, string? configs, int? currentSprintN
170
170
tasks = allTasksList . Where ( s => taskList . Where ( tl => string . Equals ( tl , s . Key , StringComparison . OrdinalIgnoreCase ) ) . Any ( ) ) ;
171
171
}
172
172
173
+ bool globalVersionBump = false ;
174
+
173
175
if ( includeLocalPackagesBuildConfig )
174
176
{
175
177
Console . WriteLine ( "Updating global version..." ) ;
@@ -204,7 +206,10 @@ private static void MainInner(string? task, string? configs, int? currentSprintN
204
206
bool anyTaskVersionUpdated = taskVersionInfo . Values . Any ( x => x . versionsUpdated . Any ( ) ) ;
205
207
bool noCurrentGlobalVersion = globalVersion is null ;
206
208
bool maxPatchForCurrentSprintGreaterOrEqualToGlobalPatch = globalVersion is not null && maxPatchForCurrentSprint >= globalVersion . Patch ;
207
- if ( anyTaskVersionUpdated || noCurrentGlobalVersion || maxPatchForCurrentSprintGreaterOrEqualToGlobalPatch )
209
+
210
+ globalVersionBump = anyTaskVersionUpdated || noCurrentGlobalVersion || maxPatchForCurrentSprintGreaterOrEqualToGlobalPatch ;
211
+
212
+ if ( globalVersionBump )
208
213
{
209
214
maxPatchForCurrentSprint = maxPatchForCurrentSprint + 1 ;
210
215
@@ -239,16 +244,19 @@ private static void MainInner(string? task, string? configs, int? currentSprintN
239
244
}
240
245
else
241
246
{
242
- if ( globalVersion . Minor == currentSprint )
243
- {
244
- globalVersion = globalVersion . CloneWithMinorAndPatch ( currentSprint , Math . Max ( maxPatchForCurrentSprint , globalVersion . Patch ) ) ;
245
- globalVersion = globalVersion . CloneWithMajor ( taskMajorVersion ) ;
246
- }
247
- else
247
+ if ( globalVersionBump )
248
248
{
249
- // this could fail if there is a task with a future-sprint version, which should not be the case. If that happens, CheckForDuplicates will throw
250
- globalVersion = globalVersion . CloneWithMinorAndPatch ( currentSprint , 0 ) ;
251
- globalVersion = globalVersion . CloneWithMajor ( taskMajorVersion ) ;
249
+ if ( globalVersion . Minor == currentSprint )
250
+ {
251
+ globalVersion = globalVersion . CloneWithMinorAndPatch ( currentSprint , Math . Max ( maxPatchForCurrentSprint , globalVersion . Patch ) ) ;
252
+ globalVersion = globalVersion . CloneWithMajor ( taskMajorVersion ) ;
253
+ }
254
+ else
255
+ {
256
+ // this could fail if there is a task with a future-sprint version, which should not be the case. If that happens, CheckForDuplicates will throw
257
+ globalVersion = globalVersion . CloneWithMinorAndPatch ( currentSprint , 0 ) ;
258
+ globalVersion = globalVersion . CloneWithMajor ( taskMajorVersion ) ;
259
+ }
252
260
}
253
261
}
254
262
}
0 commit comments