Skip to content

Commit 8f3b487

Browse files
committed
Start-proxy: Fetch OS specific binary
1 parent cba5fb5 commit 8f3b487

File tree

3 files changed

+33
-14
lines changed

3 files changed

+33
-14
lines changed

lib/start-proxy-action.js

+14-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/start-proxy-action.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/start-proxy-action.ts

+18-7
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import { getActionsLogger, Logger } from "./logging";
1010
import * as util from "./util";
1111

1212
const UPDATEJOB_PROXY = "update-job-proxy";
13-
const UPDATEJOB_PROXY_VERSION = "v2.0.20240722180912";
14-
const UPDATEJOB_PROXY_URL =
15-
"https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.18.1/update-job-proxy.tar.gz";
13+
const UPDATEJOB_PROXY_VERSION = "v2.0.20241023203727";
14+
const UPDATEJOB_PROXY_URL_PREFIX =
15+
"https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.18.1/";
1616
const PROXY_USER = "proxy_user";
1717
const KEY_SIZE = 2048;
1818
const KEY_EXPIRY_YEARS = 2;
@@ -229,17 +229,28 @@ function getProxyAuth(): BasicAuthCredentials | undefined {
229229
}
230230

231231
async function getProxyBinaryPath(): Promise<string> {
232-
let proxyBin = toolcache.find(UPDATEJOB_PROXY, UPDATEJOB_PROXY_VERSION);
232+
const proxyFileName =
233+
process.platform === "win32" ? `${UPDATEJOB_PROXY}.exe` : UPDATEJOB_PROXY;
234+
const platform =
235+
process.platform === "win32"
236+
? "win64"
237+
: process.platform === "darwin"
238+
? "osx64"
239+
: "linux64";
240+
const proxyPackage = `${UPDATEJOB_PROXY}-${platform}.tar.gz`;
241+
const proxyURL = `${UPDATEJOB_PROXY_URL_PREFIX}${proxyPackage}`;
242+
243+
let proxyBin = toolcache.find(proxyFileName, UPDATEJOB_PROXY_VERSION);
233244
if (!proxyBin) {
234-
const temp = await toolcache.downloadTool(UPDATEJOB_PROXY_URL);
245+
const temp = await toolcache.downloadTool(proxyURL);
235246
const extracted = await toolcache.extractTar(temp);
236247
proxyBin = await toolcache.cacheDir(
237248
extracted,
238-
UPDATEJOB_PROXY,
249+
proxyFileName,
239250
UPDATEJOB_PROXY_VERSION,
240251
);
241252
}
242-
proxyBin = path.join(proxyBin, UPDATEJOB_PROXY);
253+
proxyBin = path.join(proxyBin, proxyFileName);
243254
return proxyBin;
244255
}
245256

0 commit comments

Comments
 (0)