mirror of
https://github.com/github/codeql-action.git
synced 2026-10-21 02:01:27 +00:00
Use getCodeQLAssetDownloadURL for start-proxy
This commit is contained in:
62
lib/entry-points.js
generated
62
lib/entry-points.js
generated
@@ -187489,8 +187489,6 @@ async function sendFailedStatusReport(logger2, startedAt, language, unwrappedErr
|
||||
}
|
||||
}
|
||||
var UPDATEJOB_PROXY = "update-job-proxy";
|
||||
var UPDATEJOB_PROXY_VERSION = "v2.0.20250624110901";
|
||||
var UPDATEJOB_PROXY_URL_PREFIX = "https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.22.0/";
|
||||
function isPAT(value) {
|
||||
return isAuthToken(value, [
|
||||
GITHUB_PAT_CLASSIC_PATTERN,
|
||||
@@ -187608,21 +187606,11 @@ function getCredentials(logger2, registrySecrets, registriesCredentials, languag
|
||||
function getProxyPackage(platform2) {
|
||||
return `${UPDATEJOB_PROXY}-${platform2}.tar.gz`;
|
||||
}
|
||||
function getFallbackUrl(proxyPackage) {
|
||||
return `${UPDATEJOB_PROXY_URL_PREFIX}${proxyPackage}`;
|
||||
}
|
||||
async function getReleaseByVersion(version) {
|
||||
return getApiClient().rest.repos.getReleaseByTag({
|
||||
owner: "github",
|
||||
repo: "codeql-action",
|
||||
tag: version
|
||||
});
|
||||
}
|
||||
async function getCliVersionFromFeatures(features) {
|
||||
const gitHubVersion = await getGitHubVersion();
|
||||
return await features.getEnabledDefaultCliVersions(gitHubVersion.type);
|
||||
}
|
||||
async function getDownloadUrl(action) {
|
||||
async function getDownloadUrl(action, apiDetails) {
|
||||
let platform2 = getBundlePlatform(action.platform, action.arch);
|
||||
if (platform2 === void 0) {
|
||||
action.logger.warning(
|
||||
@@ -187639,33 +187627,25 @@ async function getDownloadUrl(action) {
|
||||
cliVersion,
|
||||
tagName: bundleVersion
|
||||
};
|
||||
const cliRelease = await getReleaseByVersion(versionInfo.tagName);
|
||||
for (const asset of cliRelease.data.assets) {
|
||||
if (asset.name === proxyPackage) {
|
||||
action.logger.info(
|
||||
`Found '${proxyPackage}' in release '${versionInfo.tagName}' at '${asset.url}'`
|
||||
);
|
||||
return {
|
||||
url: asset.url,
|
||||
// The `update-job-proxy` doesn't have a version as such. Since we now bundle it
|
||||
// with CodeQL CLI bundle releases, we use the corresponding CLI version to
|
||||
// differentiate between (potentially) different versions of `update-job-proxy`.
|
||||
version: versionInfo.cliVersion
|
||||
};
|
||||
}
|
||||
}
|
||||
const proxyAssetUrl = await getCodeQLAssetDownloadURL(
|
||||
action,
|
||||
apiDetails,
|
||||
versionInfo.tagName,
|
||||
proxyPackage,
|
||||
"private registry proxy"
|
||||
);
|
||||
return {
|
||||
url: proxyAssetUrl,
|
||||
// The `update-job-proxy` doesn't have a version as such. Since we now bundle it
|
||||
// with CodeQL CLI bundle releases, we use the corresponding CLI version to
|
||||
// differentiate between (potentially) different versions of `update-job-proxy`.
|
||||
version: versionInfo.cliVersion
|
||||
};
|
||||
} catch (ex) {
|
||||
action.logger.warning(
|
||||
throw new Error(
|
||||
`Failed to retrieve information about the linked release: ${getErrorMessage(ex)}`
|
||||
);
|
||||
}
|
||||
action.logger.info(
|
||||
`Did not find '${proxyPackage}' in the linked release, falling back to hard-coded version.`
|
||||
);
|
||||
return {
|
||||
url: getFallbackUrl(proxyPackage),
|
||||
version: UPDATEJOB_PROXY_VERSION
|
||||
};
|
||||
}
|
||||
async function downloadProxy(logger2, url2, authorization) {
|
||||
try {
|
||||
@@ -187708,13 +187688,12 @@ async function cacheProxy(logger2, source, filename, version) {
|
||||
function getProxyFilename() {
|
||||
return process.platform === "win32" ? `${UPDATEJOB_PROXY}.exe` : UPDATEJOB_PROXY;
|
||||
}
|
||||
async function getProxyBinaryPath(action) {
|
||||
async function getProxyBinaryPath(action, apiDetails) {
|
||||
const logger2 = action.logger;
|
||||
const proxyFileName = getProxyFilename();
|
||||
const proxyInfo = await getDownloadUrl(action);
|
||||
const proxyInfo = await getDownloadUrl(action, apiDetails);
|
||||
let proxyBin = toolcache4.find(proxyFileName, proxyInfo.version);
|
||||
if (!proxyBin) {
|
||||
const apiDetails = getApiDetails();
|
||||
const authorization = getAuthorizationHeaderFor(
|
||||
logger2,
|
||||
apiDetails,
|
||||
@@ -188091,7 +188070,10 @@ async function run7(action) {
|
||||
all_credentials: credentials,
|
||||
ca
|
||||
};
|
||||
const proxyBin = await getProxyBinaryPath({ ...action, features });
|
||||
const proxyBin = await getProxyBinaryPath(
|
||||
{ ...action, features },
|
||||
getApiDetails(action.env)
|
||||
);
|
||||
const proxyInfo = await startProxy(
|
||||
proxyBin,
|
||||
proxyConfig,
|
||||
|
||||
Reference in New Issue
Block a user