From 61d9787b984a573a7a22a9f86321572506082485 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 16 Jan 2020 10:26:36 +0000 Subject: [PATCH] Publish a build scan only if authenticated Previously, anyone could publish a scan and publishing was performed if the GRADLE_ENTERPRISE_URL environment variable was set. ge.spring.io has now been locked down to prohibit anonymous build scan publishing. This commit aligns with this change by only attempting to publish a build scan when authenticated with the server. Authentication is achieved via an access token that is made available via an environment variable on CI and locally via a file in ~/.gradle. One can obtain an access key by running the following command: ./gradlew provisionGradleEnterpriseAccessKey Closes gh-24371 --- build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ecc52e5673..a19754ee99 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,8 @@ buildScan { obfuscation { ipAddresses { addresses -> addresses.collect { address -> '0.0.0.0'} } } - publishAlwaysIf(System.getenv('GRADLE_ENTERPRISE_URL') != null) + publishAlways() + publishIfAuthenticated() server = 'https://ge.spring.io' }