Use getDefaultCliVersion for start-proxy

This commit is contained in:
Michael B. Gale
2026-02-25 17:43:15 +00:00
parent c0fc915677
commit f657c4e1eb
4 changed files with 138 additions and 50 deletions
+9 -7
View File
@@ -121699,17 +121699,19 @@ function getProxyPackage() {
function getFallbackUrl(proxyPackage) {
return `${UPDATEJOB_PROXY_URL_PREFIX}${proxyPackage}`;
}
async function getLinkedRelease() {
async function getReleaseByVersion(version) {
return getApiClient().rest.repos.getReleaseByTag({
owner: "github",
repo: "codeql-action",
tag: bundleVersion
tag: version
});
}
async function getDownloadUrl(logger) {
async function getDownloadUrl(logger, features) {
const proxyPackage = getProxyPackage();
try {
const cliRelease = await getLinkedRelease();
const gitHubVersion = await getGitHubVersion();
const versionInfo = await features.getDefaultCliVersion(gitHubVersion.type);
const cliRelease = await getReleaseByVersion(versionInfo.tagName);
for (const asset of cliRelease.data.assets) {
if (asset.name === proxyPackage) {
logger.info(
@@ -121781,9 +121783,9 @@ async function cacheProxy(logger, source, filename, version) {
function getProxyFilename() {
return process.platform === "win32" ? `${UPDATEJOB_PROXY}.exe` : UPDATEJOB_PROXY;
}
async function getProxyBinaryPath(logger) {
async function getProxyBinaryPath(logger, features) {
const proxyFileName = getProxyFilename();
const proxyInfo = await getDownloadUrl(logger);
const proxyInfo = await getDownloadUrl(logger, features);
let proxyBin = toolcache.find(proxyFileName, proxyInfo.version);
if (!proxyBin) {
const apiDetails = getApiDetails();
@@ -122141,7 +122143,7 @@ async function run(startedAt) {
all_credentials: credentials,
ca
};
const proxyBin = await getProxyBinaryPath(logger);
const proxyBin = await getProxyBinaryPath(logger, features);
const proxyInfo = await startProxy(
proxyBin,
proxyConfig,