mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Make ActionState available to getDownloadUrl
This commit is contained in:
23
lib/entry-points.js
generated
23
lib/entry-points.js
generated
@@ -163654,27 +163654,27 @@ async function getCliVersionFromFeatures(features) {
|
||||
const gitHubVersion = await getGitHubVersion();
|
||||
return await features.getEnabledDefaultCliVersions(gitHubVersion.type);
|
||||
}
|
||||
async function getDownloadUrl(logger, features) {
|
||||
let platform2 = getBundlePlatform();
|
||||
async function getDownloadUrl(action) {
|
||||
let platform2 = getBundlePlatform(action.platform, action.arch);
|
||||
if (platform2 === void 0) {
|
||||
logger.warning(
|
||||
action.logger.warning(
|
||||
`Unsupported platform ${process.platform} on architecture ${process.arch}, defaulting to ${"linux64" /* Linux64 */}`
|
||||
);
|
||||
platform2 = "linux64" /* Linux64 */;
|
||||
}
|
||||
const proxyPackage = getProxyPackage(platform2);
|
||||
try {
|
||||
const useFeaturesToDetermineCLI = await features.getValue(
|
||||
const useFeaturesToDetermineCLI = await action.features.getValue(
|
||||
"start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */
|
||||
);
|
||||
const versionInfo = useFeaturesToDetermineCLI ? (await getCliVersionFromFeatures(features)).enabledVersions[0] : {
|
||||
const versionInfo = useFeaturesToDetermineCLI ? (await getCliVersionFromFeatures(action.features)).enabledVersions[0] : {
|
||||
cliVersion,
|
||||
tagName: bundleVersion
|
||||
};
|
||||
const cliRelease = await getReleaseByVersion(versionInfo.tagName);
|
||||
for (const asset of cliRelease.data.assets) {
|
||||
if (asset.name === proxyPackage) {
|
||||
logger.info(
|
||||
action.logger.info(
|
||||
`Found '${proxyPackage}' in release '${versionInfo.tagName}' at '${asset.url}'`
|
||||
);
|
||||
return {
|
||||
@@ -163687,11 +163687,11 @@ async function getDownloadUrl(logger, features) {
|
||||
}
|
||||
}
|
||||
} catch (ex) {
|
||||
logger.warning(
|
||||
action.logger.warning(
|
||||
`Failed to retrieve information about the linked release: ${getErrorMessage(ex)}`
|
||||
);
|
||||
}
|
||||
logger.info(
|
||||
action.logger.info(
|
||||
`Did not find '${proxyPackage}' in the linked release, falling back to hard-coded version.`
|
||||
);
|
||||
return {
|
||||
@@ -163740,9 +163740,10 @@ async function cacheProxy(logger, source, filename, version) {
|
||||
function getProxyFilename() {
|
||||
return process.platform === "win32" ? `${UPDATEJOB_PROXY}.exe` : UPDATEJOB_PROXY;
|
||||
}
|
||||
async function getProxyBinaryPath(logger, features) {
|
||||
async function getProxyBinaryPath(action) {
|
||||
const logger = action.logger;
|
||||
const proxyFileName = getProxyFilename();
|
||||
const proxyInfo = await getDownloadUrl(logger, features);
|
||||
const proxyInfo = await getDownloadUrl(action);
|
||||
let proxyBin = toolcache4.find(proxyFileName, proxyInfo.version);
|
||||
if (!proxyBin) {
|
||||
const apiDetails = getApiDetails();
|
||||
@@ -164122,7 +164123,7 @@ async function run7(action) {
|
||||
all_credentials: credentials,
|
||||
ca
|
||||
};
|
||||
const proxyBin = await getProxyBinaryPath(logger, features);
|
||||
const proxyBin = await getProxyBinaryPath({ ...action, features });
|
||||
const proxyInfo = await startProxy(
|
||||
proxyBin,
|
||||
proxyConfig,
|
||||
|
||||
Reference in New Issue
Block a user