mirror of
https://github.com/github/codeql-action.git
synced 2026-05-12 17:00:15 +00:00
Add proxy_ca_certificate_file output to start-proxy action
Useful to avoid duplicating this across different extractors (e.g. C# and Go)
This commit is contained in:
Generated
+12
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const child_process_1 = require("child_process");
|
||||
const fs = __importStar(require("fs"));
|
||||
const path = __importStar(require("path"));
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const toolcache = __importStar(require("@actions/tool-cache"));
|
||||
@@ -111,6 +112,16 @@ async function runWrapper() {
|
||||
all_credentials: credentials,
|
||||
ca,
|
||||
};
|
||||
// Try to write the certificate to disk. Some extractors may use this to populate
|
||||
// the `SSL_CERT_FILE` environment variable.
|
||||
try {
|
||||
const certificatePath = path.join(actionsUtil.getTemporaryDirectory(), "codeql_package_proxy.crt");
|
||||
fs.writeFileSync(certificatePath, ca.cert);
|
||||
proxyConfig.ca_certificate_file = certificatePath;
|
||||
}
|
||||
catch (error) {
|
||||
logger.error(`Failed to write the proxy certificate to disk: ${util.getErrorMessage(error)}`);
|
||||
}
|
||||
// Start the Proxy
|
||||
const proxyBin = await getProxyBinaryPath();
|
||||
await startProxy(proxyBin, proxyConfig, proxyLogFilePath, logger);
|
||||
@@ -154,6 +165,7 @@ async function startProxy(binPath, config, logFilePath, logger) {
|
||||
core.setOutput("proxy_host", host);
|
||||
core.setOutput("proxy_port", port.toString());
|
||||
core.setOutput("proxy_ca_certificate", config.ca.cert);
|
||||
core.setOutput("proxy_ca_certificate_file", config.ca_certificate_file);
|
||||
const registry_urls = config.all_credentials
|
||||
.filter((credential) => credential.url !== undefined)
|
||||
.map((credential) => ({
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user