Skip to content

Commit 7acb183

Browse files
authored
Fix misplaced guard for checking for updates on CI (#966)
1 parent cab5211 commit 7acb183

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/docs-builder/Cli/CheckForUpdatesFilter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ internal sealed class CheckForUpdatesFilter(ConsoleAppFilter next) : ConsoleAppF
1616
public override async Task InvokeAsync(ConsoleAppContext context, Cancel ctx)
1717
{
1818
await Next.InvokeAsync(context, ctx);
19+
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("CI")))
20+
return;
21+
1922
var latestVersionUrl = await GetLatestVersion(ctx);
2023
if (latestVersionUrl is null)
2124
ConsoleApp.LogError("Unable to determine latest version");
@@ -54,9 +57,6 @@ private static void CompareWithAssemblyVersion(Uri latestVersionUrl)
5457

5558
private async ValueTask<Uri?> GetLatestVersion(Cancel ctx)
5659
{
57-
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("CI")))
58-
return null;
59-
6060
// only check for new versions once per hour
6161
if (_stateFile.Exists && _stateFile.LastWriteTimeUtc >= DateTime.UtcNow.Subtract(TimeSpan.FromHours(1)))
6262
{

0 commit comments

Comments
 (0)