Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/docs-builder/Cli/CheckForUpdatesFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ internal sealed class CheckForUpdatesFilter(ConsoleAppFilter next) : ConsoleAppF
public override async Task InvokeAsync(ConsoleAppContext context, Cancel ctx)
{
await Next.InvokeAsync(context, ctx);
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("CI")))
return;

var latestVersionUrl = await GetLatestVersion(ctx);
if (latestVersionUrl is null)
ConsoleApp.LogError("Unable to determine latest version");
Expand Down Expand Up @@ -54,9 +57,6 @@ private static void CompareWithAssemblyVersion(Uri latestVersionUrl)

private async ValueTask<Uri?> GetLatestVersion(Cancel ctx)
{
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("CI")))
return null;

// only check for new versions once per hour
if (_stateFile.Exists && _stateFile.LastWriteTimeUtc >= DateTime.UtcNow.Subtract(TimeSpan.FromHours(1)))
{
Expand Down
Loading