summaryrefslogtreecommitdiff
path: root/packages/cli/src/utils/gitUtils.ts
diff options
context:
space:
mode:
authorSeth Vargo <[email protected]>2025-08-11 21:32:23 -0400
committerGitHub <[email protected]>2025-08-12 01:32:23 +0000
commitd8fec54e817e74f2de533e511cfd31ae93f58963 (patch)
tree0152798c05b43a267d01c26d60de3c4e305605cf /packages/cli/src/utils/gitUtils.ts
parent26fe587b441087ec6894ccf347fa9859f5feae81 (diff)
feat(/setup-github): Use node to download the files (#5863)
Diffstat (limited to 'packages/cli/src/utils/gitUtils.ts')
-rw-r--r--packages/cli/src/utils/gitUtils.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/packages/cli/src/utils/gitUtils.ts b/packages/cli/src/utils/gitUtils.ts
index f5f9cb92..7b271ac4 100644
--- a/packages/cli/src/utils/gitUtils.ts
+++ b/packages/cli/src/utils/gitUtils.ts
@@ -5,7 +5,7 @@
*/
import { execSync } from 'child_process';
-import { ProxyAgent, setGlobalDispatcher } from 'undici';
+import { ProxyAgent } from 'undici';
/**
* Checks if a directory is within a git repository hosted on GitHub.
@@ -57,9 +57,6 @@ export const getLatestGitHubRelease = async (
): Promise<string> => {
try {
const controller = new AbortController();
- if (proxy) {
- setGlobalDispatcher(new ProxyAgent(proxy));
- }
const endpoint = `https://api.github.com/repos/google-github-actions/run-gemini-cli/releases/latest`;
@@ -70,8 +67,9 @@ export const getLatestGitHubRelease = async (
'Content-Type': 'application/json',
'X-GitHub-Api-Version': '2022-11-28',
},
- signal: controller.signal,
- });
+ dispatcher: proxy ? new ProxyAgent(proxy) : undefined,
+ signal: AbortSignal.any([AbortSignal.timeout(30_000), controller.signal]),
+ } as RequestInit);
if (!response.ok) {
throw new Error(