Ensure consistent apiDetails in getReleaseByVersion and getProxyBinaryPath

This commit is contained in:
Michael B. Gale
2026-10-14 12:07:12 +01:00
parent 8c32ebe976
commit bd015c2686
3 changed files with 42 additions and 15 deletions

14
lib/entry-points.js generated
View File

@@ -187796,8 +187796,8 @@ function getProxyPackage(platform2) {
function getFallbackUrl(proxyPackage) {
return `${UPDATEJOB_PROXY_URL_PREFIX}${proxyPackage}`;
}
async function getReleaseByVersion(version) {
return getApiClient().rest.repos.getReleaseByTag({
async function getReleaseByVersion(env, apiDetails, version) {
return getApiClient(env, apiDetails).rest.repos.getReleaseByTag({
owner: "github",
repo: "codeql-action",
tag: version
@@ -187807,7 +187807,7 @@ 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(
@@ -187824,7 +187824,11 @@ async function getDownloadUrl(action) {
cliVersion,
tagName: bundleVersion
};
const cliRelease = await getReleaseByVersion(versionInfo.tagName);
const cliRelease = await getReleaseByVersion(
action.env,
apiDetails,
versionInfo.tagName
);
for (const asset of cliRelease.data.assets) {
if (asset.name === proxyPackage) {
action.logger.info(
@@ -187898,7 +187902,7 @@ async function getProxyBinaryPath(action) {
const apiDetails = getApiDetails();
const client = new InstanceApiClient(apiDetails);
const proxyFileName = getProxyFilename();
const proxyInfo = await getDownloadUrl(action);
const proxyInfo = await getDownloadUrl(action, apiDetails);
let proxyBin = toolcache4.find(proxyFileName, proxyInfo.version);
if (!proxyBin) {
const authorization = client.getAuthorizationHeaderFor(