Clean-up logic for overriding proxy

This commit is contained in:
Marco Gario
2025-04-01 14:52:32 +00:00
parent 4c3e536282
commit a3e50f3d11
3 changed files with 19 additions and 18 deletions

View File

@@ -202,15 +202,6 @@ async function run() {
let didUploadTrapCaches = false;
util.initializeEnvironment(actionsUtil.getActionVersion());
// Unset the CODEQL_PROXY_* environment variables, as they are not needed
// and can cause issues with the CodeQL CLI
// Check for CODEQL_PROXY_HOST: and if it is empty but set, unset it
if (process.env.CODEQL_PROXY_HOST === "") {
delete process.env.CODEQL_PROXY_HOST;
delete process.env.CODEQL_PROXY_PORT;
delete process.env.CODEQL_PROXY_CA_CERTIFICATE;
}
// Make inputs accessible in the `post` step, details at
// https://github.com/github/codeql-action/issues/2553
actionsUtil.persistInputs();
@@ -244,6 +235,16 @@ async function run() {
);
}
// Unset the CODEQL_PROXY_* environment variables, as they are not needed
// and can cause issues with older CodeQL CLIs.
// Check for CODEQL_PROXY_HOST: and if it is empty but set, unset it.
if (process.env.CODEQL_PROXY_HOST === "" && !(await util.codeQlVersionAtLeast(codeql, "2.20.7"))) {
delete process.env.CODEQL_PROXY_HOST;
delete process.env.CODEQL_PROXY_PORT;
delete process.env.CODEQL_PROXY_CA_CERTIFICATE;
}
const apiDetails = getApiDetails();
const outputDir = actionsUtil.getRequiredInput("output");
core.exportVariable(EnvVar.SARIF_RESULTS_OUTPUT_DIR, outputDir);