diff --git a/src/Elastic.Markdown/DocumentationGenerator.cs b/src/Elastic.Markdown/DocumentationGenerator.cs index bb61348d0..149512bc8 100644 --- a/src/Elastic.Markdown/DocumentationGenerator.cs +++ b/src/Elastic.Markdown/DocumentationGenerator.cs @@ -88,10 +88,10 @@ public async Task ResolveDirectoryTree(Cancel ctx) public async Task GenerateAll(Cancel ctx) { var generationState = GetPreviousGenerationState(); - if (!Context.SkipMetadata && (Context.Force || generationState == null)) - DocumentationSet.ClearOutputDirectory(); // always delete output folder on CI - else if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("GITHUB_ACTIONS"))) + if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("GITHUB_ACTIONS"))) + DocumentationSet.ClearOutputDirectory(); + else if (!Context.SkipMetadata && (Context.Force || generationState == null)) DocumentationSet.ClearOutputDirectory(); if (CompilationNotNeeded(generationState, out var offendingFiles, out var outputSeenChanges))