@@ -270,15 +270,10 @@ public Map<String, String> getEnvironment() {
270270 env .put ("REQUESTS_CA_BUNDLE" , caFile );
271271 env .put ("CURL_CA_BUNDLE" , caFile );
272272 env .put ("GIT_SSL_CAINFO" , caFile );
273- env .put ("GH_TOKEN" , "" );
274- env .put ("GITHUB_TOKEN" , "" );
275- env .put ("GH_ENTERPRISE_TOKEN" , "" );
276- env .put ("GITHUB_ENTERPRISE_TOKEN" , "" );
277- }
278-
279- if ("true" .equals (System .getenv ("GITHUB_ACTIONS" ))) {
280273 env .put ("GH_TOKEN" , "fake-token-for-e2e-tests" );
281274 env .put ("GITHUB_TOKEN" , "fake-token-for-e2e-tests" );
275+ env .put ("GH_ENTERPRISE_TOKEN" , "" );
276+ env .put ("GITHUB_ENTERPRISE_TOKEN" , "" );
282277 }
283278
284279 return env ;
@@ -291,13 +286,7 @@ public Map<String, String> getEnvironment() {
291286 */
292287 public CopilotClient createClient () {
293288 CopilotClientOptions options = new CopilotClientOptions ().setCliPath (cliPath ).setCwd (workDir .toString ())
294- .setEnvironment (getEnvironment ());
295-
296- // In CI (GitHub Actions), use a fake token to avoid auth issues
297- String ci = System .getenv ("GITHUB_ACTIONS" );
298- if (ci != null && !ci .isEmpty ()) {
299- options .setGitHubToken ("fake-token-for-e2e-tests" );
300- }
289+ .setEnvironment (getEnvironment ()).setGitHubToken ("fake-token-for-e2e-tests" );
301290
302291 return new CopilotClient (options );
303292 }
@@ -321,10 +310,7 @@ public CopilotClient createClient(CopilotClientOptions options) {
321310 if (options .getEnvironment () == null || options .getEnvironment ().isEmpty ()) {
322311 options .setEnvironment (getEnvironment ());
323312 }
324-
325- // In CI (GitHub Actions), use a fake token to avoid auth issues
326- String ci = System .getenv ("GITHUB_ACTIONS" );
327- if (ci != null && !ci .isEmpty () && options .getGitHubToken () == null ) {
313+ if (options .getGitHubToken () == null ) {
328314 options .setGitHubToken ("fake-token-for-e2e-tests" );
329315 }
330316
0 commit comments