From b63756f4f41ae1f9e7589b40d228b654b2de71bb Mon Sep 17 00:00:00 2001 From: Mattias Karlsson Date: Fri, 16 Oct 2026 21:11:36 +0200 Subject: [PATCH] Report DPI only when Logs Ingestion Endpoint and RuleId are set. Co-authored-by: Cursor --- build/records.cs | 4 ++++ cake.cs | 14 +------------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/build/records.cs b/build/records.cs index e9331da..364835a 100644 --- a/build/records.cs +++ b/build/records.cs @@ -48,6 +48,10 @@ 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 5465e8e..d6b3c73 100755 --- a/cake.cs +++ b/cake.cs @@ -174,19 +174,7 @@ .Append("../../../") .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" )