Skip to content

Commit

Permalink
Start-proxy: Fetch OS specific binary
Browse files Browse the repository at this point in the history
  • Loading branch information
marcogario committed Nov 19, 2024
1 parent cba5fb5 commit 0316210
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
18 changes: 12 additions & 6 deletions lib/start-proxy-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 13 additions & 7 deletions src/start-proxy-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import { getActionsLogger, Logger } from "./logging";
import * as util from "./util";

const UPDATEJOB_PROXY = "update-job-proxy";
const UPDATEJOB_PROXY_VERSION = "v2.0.20240722180912";
const UPDATEJOB_PROXY_URL =
"https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.18.1/update-job-proxy.tar.gz";
const UPDATEJOB_PROXY_VERSION = "v2.0.20241023203727";
const UPDATEJOB_PROXY_URL_PREFIX = "https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.18.1/";

Check failure

Code scanning / ESLint

Ensure code is properly formatted, use insertion, deletion, or replacement to obtain desired formatting. Error

Insert ⏎·
const PROXY_USER = "proxy_user";
const KEY_SIZE = 2048;
const KEY_EXPIRY_YEARS = 2;
Expand Down Expand Up @@ -229,17 +228,24 @@ function getProxyAuth(): BasicAuthCredentials | undefined {
}

async function getProxyBinaryPath(): Promise<string> {
let proxyBin = toolcache.find(UPDATEJOB_PROXY, UPDATEJOB_PROXY_VERSION);
const proxyFileName = process.platform === "win32" ? `${UPDATEJOB_PROXY}.exe` : UPDATEJOB_PROXY;

Check failure

Code scanning / ESLint

Ensure code is properly formatted, use insertion, deletion, or replacement to obtain desired formatting. Error

Insert ⏎···
const platform = process.platform === "win32" ? "win64" :

Check failure

Code scanning / ESLint

Ensure code is properly formatted, use insertion, deletion, or replacement to obtain desired formatting. Error

Replace ·process.platform·===·"win32"·?·"win64"·: with ⏎····process.platform·===·"win32"⏎······?·"win64"
process.platform === "darwin" ? "macos64" :

Check failure

Code scanning / ESLint

Ensure code is properly formatted, use insertion, deletion, or replacement to obtain desired formatting. Error

Replace process.platform·===·"darwin"·?·"macos64"·: with ··:·process.platform·===·"darwin"⏎······?·"macos64"
"linux64";

Check failure

Code scanning / ESLint

Ensure code is properly formatted, use insertion, deletion, or replacement to obtain desired formatting. Error

Insert ···:
const proxyPackage = `${UPDATEJOB_PROXY}-${platform}.tar.gz`;
const proxyURL = `${UPDATEJOB_PROXY_URL_PREFIX}${proxyPackage}`;

let proxyBin = toolcache.find(proxyFileName, UPDATEJOB_PROXY_VERSION);
if (!proxyBin) {
const temp = await toolcache.downloadTool(UPDATEJOB_PROXY_URL);
const temp = await toolcache.downloadTool(proxyURL);
const extracted = await toolcache.extractTar(temp);
proxyBin = await toolcache.cacheDir(
extracted,
UPDATEJOB_PROXY,
proxyFileName,
UPDATEJOB_PROXY_VERSION,
);
}
proxyBin = path.join(proxyBin, UPDATEJOB_PROXY);
proxyBin = path.join(proxyBin, proxyFileName);
return proxyBin;
}

Expand Down

0 comments on commit 0316210

Please sign in to comment.