Use ActionState for getRegistryProxy

This commit is contained in:
Michael B. Gale
2026-07-14 16:17:51 +01:00
parent 6d70593fb7
commit 205b37b035
4 changed files with 36 additions and 35 deletions

10
lib/entry-points.js generated
View File

@@ -145620,10 +145620,10 @@ function parseRepositoryNwo(input) {
// src/api-client.ts
var GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version";
var DO_NOT_RETRY_STATUSES = [400, 410, 422, 451];
function getRegistryProxy(env) {
const host = env.getOptional("CODEQL_PROXY_HOST" /* PROXY_HOST */);
const port = env.getOptional("CODEQL_PROXY_PORT" /* PROXY_PORT */);
const cert = env.getOptional("CODEQL_PROXY_CA_CERTIFICATE" /* PROXY_CA_CERTIFICATE */);
function getRegistryProxy(action) {
const host = action.env.getOptional("CODEQL_PROXY_HOST" /* PROXY_HOST */);
const port = action.env.getOptional("CODEQL_PROXY_PORT" /* PROXY_PORT */);
const cert = action.env.getOptional("CODEQL_PROXY_CA_CERTIFICATE" /* PROXY_CA_CERTIFICATE */);
if (host && port) {
return new import_undici.ProxyAgent({
uri: `http://${host}:${port}`,
@@ -148091,7 +148091,7 @@ async function getRemoteConfig(actionState, configFile, apiDetails) {
const shouldProxyRequest = await actionState.features.getValue(
"proxy_api_requests" /* ProxyApiRequests */
);
const proxy = shouldProxyRequest ? getRegistryProxy(actionState.env) : void 0;
const proxy = shouldProxyRequest ? getRegistryProxy(actionState) : void 0;
const response = await getApiClientWithExternalAuth(apiDetails, proxy).rest.repos.getContent({
owner: address.owner,
repo: address.repo,