From 2b62fbcfeabfe75b1c5d0224987f8fcb23adf87b Mon Sep 17 00:00:00 2001 From: Daniel Palme Date: Tue, 28 May 2024 19:11:05 +0200 Subject: [PATCH] #674: License can now be supplied via the REPORTGENERATOR_LICENSE environment variable --- src/Readme.txt | 4 ++++ src/ReportGenerator.Core/ReportConfigurationBuilder.cs | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/Readme.txt b/src/Readme.txt index 2d178763..b8881129 100644 --- a/src/Readme.txt +++ b/src/Readme.txt @@ -67,6 +67,10 @@ For further details take a look at LICENSE.txt. CHANGELOG +5.3.5.0 + + * New: #674: License can now be supplied via the REPORTGENERATOR_LICENSE environment variable + 5.3.4.0 * New: #664: Added filter options for risk hotspots: '-riskhotspotassemblyfilters:', '-riskhotspotclassfilters:' diff --git a/src/ReportGenerator.Core/ReportConfigurationBuilder.cs b/src/ReportGenerator.Core/ReportConfigurationBuilder.cs index 26865e0e..d1fff22d 100644 --- a/src/ReportGenerator.Core/ReportConfigurationBuilder.cs +++ b/src/ReportGenerator.Core/ReportConfigurationBuilder.cs @@ -252,6 +252,8 @@ public ReportConfiguration Create(Dictionary cliArguments) title = value; } + string licenseFromEnviroment = Environment.GetEnvironmentVariable("REPORTGENERATOR_LICENSE"); + if (namedArguments.TryGetValue(CommandLineArgumentNames.License, out value)) { license = value; @@ -260,6 +262,10 @@ public ReportConfiguration Create(Dictionary cliArguments) { license = value; } + else if (licenseFromEnviroment != null) + { + license = licenseFromEnviroment; + } return new ReportConfiguration( reportFilePatterns,