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