@@ -142,22 +142,24 @@ public static String asString() {
142142 // List of CI/CD providers and their environment variables for detection
143143 private static List <CicdProvider > listCiCdProviders () {
144144 return Arrays .asList (
145- new CicdProvider ("github" , Collections .singletonList (new EnvVar ("GITHUB_ACTIONS" , "true" ))),
146- new CicdProvider ("gitlab" , Collections .singletonList (new EnvVar ("GITLAB_CI" , "true" ))),
147- new CicdProvider ("jenkins" , Collections .singletonList (new EnvVar ("JENKINS_URL" , "" ))),
148- new CicdProvider ("azure-devops" , Collections .singletonList (new EnvVar ("TF_BUILD" , "True" ))),
149- new CicdProvider ("circle" , Collections .singletonList (new EnvVar ("CIRCLECI" , "true" ))),
150- new CicdProvider ("travis" , Collections .singletonList (new EnvVar ("TRAVIS" , "true" ))),
151- new CicdProvider ("bitbucket" , Collections .singletonList (new EnvVar ("BITBUCKET_BUILD_NUMBER" , "" ))),
152- new CicdProvider ("google-cloud-build" , Arrays .asList (
153- new EnvVar ("PROJECT_ID" , "" ),
154- new EnvVar ("BUILD_ID" , "" ),
155- new EnvVar ("PROJECT_NUMBER" , "" ),
156- new EnvVar ("LOCATION" , "" )
157- )),
158- new CicdProvider ("aws-code-build" , Collections .singletonList (new EnvVar ("CODEBUILD_BUILD_ARN" , "" ))),
159- new CicdProvider ("tf-cloud" , Collections .singletonList (new EnvVar ("TFC_RUN_ID" , "" )))
160- );
145+ new CicdProvider ("github" , Collections .singletonList (new EnvVar ("GITHUB_ACTIONS" , "true" ))),
146+ new CicdProvider ("gitlab" , Collections .singletonList (new EnvVar ("GITLAB_CI" , "true" ))),
147+ new CicdProvider ("jenkins" , Collections .singletonList (new EnvVar ("JENKINS_URL" , "" ))),
148+ new CicdProvider ("azure-devops" , Collections .singletonList (new EnvVar ("TF_BUILD" , "True" ))),
149+ new CicdProvider ("circle" , Collections .singletonList (new EnvVar ("CIRCLECI" , "true" ))),
150+ new CicdProvider ("travis" , Collections .singletonList (new EnvVar ("TRAVIS" , "true" ))),
151+ new CicdProvider (
152+ "bitbucket" , Collections .singletonList (new EnvVar ("BITBUCKET_BUILD_NUMBER" , "" ))),
153+ new CicdProvider (
154+ "google-cloud-build" ,
155+ Arrays .asList (
156+ new EnvVar ("PROJECT_ID" , "" ),
157+ new EnvVar ("BUILD_ID" , "" ),
158+ new EnvVar ("PROJECT_NUMBER" , "" ),
159+ new EnvVar ("LOCATION" , "" ))),
160+ new CicdProvider (
161+ "aws-code-build" , Collections .singletonList (new EnvVar ("CODEBUILD_BUILD_ARN" , "" ))),
162+ new CicdProvider ("tf-cloud" , Collections .singletonList (new EnvVar ("TFC_RUN_ID" , "" ))));
161163 }
162164
163165 // Volatile field to ensure thread-safe lazy initialization
@@ -231,7 +233,11 @@ private static String cicdProvider() {
231233
232234 private static Environment env () {
233235 if (env == null ) {
234- env = new Environment (System .getenv (), System .getenv ("PATH" ).split (File .pathSeparator ), System .getProperty ("os.name" ));
236+ env =
237+ new Environment (
238+ System .getenv (),
239+ System .getenv ("PATH" ).split (File .pathSeparator ),
240+ System .getProperty ("os.name" ));
235241 }
236242 return env ;
237243 }
0 commit comments