mirror of
https://github.com/github/codeql-action.git
synced 2026-04-09 13:42:40 +00:00
Merge pull request #2741 from github/reset_proxy_envs
Properly unset proxy env if empty
This commit is contained in:
8
lib/analyze-action.js
generated
8
lib/analyze-action.js
generated
@@ -160,6 +160,14 @@ async function run() {
|
||||
let dbCreationTimings = undefined;
|
||||
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();
|
||||
|
||||
File diff suppressed because one or more lines are too long
4
lib/start-proxy-action.js
generated
4
lib/start-proxy-action.js
generated
@@ -99,6 +99,10 @@ async function runWrapper() {
|
||||
core.saveState("proxy-log-file", proxyLogFilePath);
|
||||
// Get the configuration options
|
||||
const credentials = (0, start_proxy_1.getCredentials)(logger, actionsUtil.getOptionalInput("registry_secrets"), actionsUtil.getOptionalInput("registries_credentials"), actionsUtil.getOptionalInput("language"));
|
||||
if (credentials.length === 0) {
|
||||
logger.info("No credentials found, skipping proxy setup.");
|
||||
return;
|
||||
}
|
||||
logger.info(`Credentials loaded for the following registries:\n ${credentials
|
||||
.map((c) => credentialToStr(c))
|
||||
.join("\n")}`);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -202,6 +202,15 @@ 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();
|
||||
|
||||
@@ -99,6 +99,12 @@ async function runWrapper() {
|
||||
actionsUtil.getOptionalInput("registries_credentials"),
|
||||
actionsUtil.getOptionalInput("language"),
|
||||
);
|
||||
|
||||
if (credentials.length === 0) {
|
||||
logger.info("No credentials found, skipping proxy setup.");
|
||||
return;
|
||||
}
|
||||
|
||||
logger.info(
|
||||
`Credentials loaded for the following registries:\n ${credentials
|
||||
.map((c) => credentialToStr(c))
|
||||
|
||||
Reference in New Issue
Block a user