@@ -285,6 +285,13 @@ private static ExitCodes OnGetVersionCommand(string projectPath, string format,
285285 }
286286
287287 var oracle = new VersionOracle ( searchPath , repository , commit , CloudBuild . Active ) ;
288+
289+ // Take the PublicRelease environment variable into account, since the build would as well.
290+ if ( ! string . IsNullOrWhiteSpace ( Environment . GetEnvironmentVariable ( "PublicRelease" ) ) && bool . TryParse ( Environment . GetEnvironmentVariable ( "PublicRelease" ) , out bool publicRelease ) )
291+ {
292+ oracle . PublicRelease = publicRelease ;
293+ }
294+
288295 if ( string . IsNullOrEmpty ( singleVariable ) )
289296 {
290297 switch ( format . ToLowerInvariant ( ) )
@@ -573,7 +580,7 @@ private static ExitCodes OnPrepareReleaseCommand(string projectPath, string prer
573580 }
574581
575582 // nextVersion and versionIncrement parameters cannot be combined
576- if ( ! string . IsNullOrEmpty ( nextVersion ) && ! string . IsNullOrEmpty ( versionIncrement ) )
583+ if ( ! string . IsNullOrEmpty ( nextVersion ) && ! string . IsNullOrEmpty ( versionIncrement ) )
577584 {
578585 Console . Error . WriteLine ( "Options 'nextVersion' and 'versionIncrement' cannot be used at the same time." ) ;
579586 return ExitCodes . InvalidParameters ;
@@ -583,7 +590,7 @@ private static ExitCodes OnPrepareReleaseCommand(string projectPath, string prer
583590 VersionOptions . ReleaseVersionIncrement ? versionIncrementParsed = default ;
584591 if ( ! string . IsNullOrEmpty ( versionIncrement ) )
585592 {
586- if ( ! Enum . TryParse < VersionOptions . ReleaseVersionIncrement > ( versionIncrement , true , out var parsed ) )
593+ if ( ! Enum . TryParse < VersionOptions . ReleaseVersionIncrement > ( versionIncrement , true , out var parsed ) )
587594 {
588595 Console . Error . WriteLine ( $ "\" { versionIncrement } \" is not a valid version increment") ;
589596 return ExitCodes . InvalidVersionIncrement ;
0 commit comments