mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Add debugging options to JAVA_TOOL_OPTIONS when FF is enabled
This commit is contained in:
14
lib/init-action.js
generated
14
lib/init-action.js
generated
@@ -103372,6 +103372,13 @@ function getRequiredEnvParam(paramName) {
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function getOptionalEnvVar(paramName) {
|
||||
const value = process.env[paramName];
|
||||
if (value?.trim().length === 0) {
|
||||
return void 0;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
var HTTPError = class extends Error {
|
||||
status;
|
||||
constructor(message, status) {
|
||||
@@ -109469,6 +109476,13 @@ exec ${goBinaryPath} "$@"`
|
||||
core13.exportVariable(key, value);
|
||||
}
|
||||
}
|
||||
if (await features.getValue("java_network_debugging" /* JavaNetworkDebugging */)) {
|
||||
const existingJavaToolOptions = getOptionalEnvVar("JAVA_TOOL_OPTIONS") || "";
|
||||
core13.exportVariable(
|
||||
"JAVA_TOOL_OPTIONS",
|
||||
`${existingJavaToolOptions} -Djavax.net.debug=ssl,handshake,certpath`
|
||||
);
|
||||
}
|
||||
flushDiagnostics(config);
|
||||
await saveConfig(config, logger);
|
||||
core13.setOutput("codeql-path", config.codeQLCmd);
|
||||
|
||||
@@ -95,6 +95,7 @@ import {
|
||||
BuildMode,
|
||||
GitHubVersion,
|
||||
Result,
|
||||
getOptionalEnvVar,
|
||||
} from "./util";
|
||||
import { checkWorkflow } from "./workflow";
|
||||
|
||||
@@ -753,6 +754,19 @@ async function run(startedAt: Date) {
|
||||
}
|
||||
}
|
||||
|
||||
// Enable Java network debugging if the FF is enabled.
|
||||
if (await features.getValue(Feature.JavaNetworkDebugging)) {
|
||||
// Get the existing value of `JAVA_OPTS`, if any.
|
||||
const existingJavaToolOptions =
|
||||
getOptionalEnvVar("JAVA_TOOL_OPTIONS") || "";
|
||||
|
||||
// Add the network debugging options.
|
||||
core.exportVariable(
|
||||
"JAVA_TOOL_OPTIONS",
|
||||
`${existingJavaToolOptions} -Djavax.net.debug=ssl,handshake,certpath`,
|
||||
);
|
||||
}
|
||||
|
||||
// Write diagnostics to the database that we previously stored in memory because the database
|
||||
// did not exist until now.
|
||||
flushDiagnostics(config);
|
||||
|
||||
Reference in New Issue
Block a user