From d83a41e643b2bb1b63fabfdbad928ed3c023413d Mon Sep 17 00:00:00 2001 From: Mattias Karlsson Date: Fri, 16 Oct 2026 21:12:25 +0200 Subject: [PATCH] Report DPI only when Logs Ingestion Endpoint and RuleId are set --- build/records.cs | 5 +++++ cake.cs | 14 +------------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/build/records.cs b/build/records.cs index 0bce6a6..62deada 100644 --- a/build/records.cs +++ b/build/records.cs @@ -39,6 +39,11 @@ public bool ShouldPushNuGetPackages() => IsMainBranch && !string.IsNullOrWhiteSpace(NuGetSource) && !string.IsNullOrWhiteSpace(NuGetApiKey); + public bool ShouldReportDPI() => + !string.IsNullOrWhiteSpace(System.Environment.GetEnvironmentVariable("NuGetReportSettings_Endpoint")) + && !string.IsNullOrWhiteSpace(System.Environment.GetEnvironmentVariable("NuGetReportSettings_RuleId")); + + public ICollection DirectoryPathsToClean = new []{ ArtifactsPath, OutputPath, diff --git a/cake.cs b/cake.cs index 12b4490..2d2b4d1 100644 --- a/cake.cs +++ b/cake.cs @@ -92,19 +92,7 @@ .Append("--silent") .AppendSwitchQuoted("--output", "table") .Append( - ( -( - !string.IsNullOrWhiteSpace(context.EnvironmentVariable("NuGetReportSettings_Endpoint")) - && - !string.IsNullOrWhiteSpace(context.EnvironmentVariable("NuGetReportSettings_RuleId")) - ) - || - ( - !string.IsNullOrWhiteSpace(context.EnvironmentVariable("NuGetReportSettings_SharedKey")) - && - !string.IsNullOrWhiteSpace(context.EnvironmentVariable("NuGetReportSettings_WorkspaceId")) - ) - ) + data.ShouldReportDPI() ? "report" : "analyze" )