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" )