mirror of
https://github.com/github/codeql-action.git
synced 2026-04-26 16:58:47 +00:00
Send a basic status report in start-proxy Action if it succeeds
This commit is contained in:
Generated
+14
@@ -95752,6 +95752,19 @@ function generateCertificateAuthority() {
|
||||
const key = import_node_forge.pki.privateKeyToPem(keys.privateKey);
|
||||
return { cert: pem, key };
|
||||
}
|
||||
async function sendSuccessStatusReport(startedAt, logger) {
|
||||
const statusReportBase = await createStatusReportBase(
|
||||
"start-proxy" /* StartProxy */,
|
||||
"success",
|
||||
startedAt,
|
||||
void 0,
|
||||
await checkDiskUsage(logger),
|
||||
logger
|
||||
);
|
||||
if (statusReportBase !== void 0) {
|
||||
await sendStatusReport(statusReportBase);
|
||||
}
|
||||
}
|
||||
async function runWrapper() {
|
||||
const startedAt = /* @__PURE__ */ new Date();
|
||||
persistInputs();
|
||||
@@ -95781,6 +95794,7 @@ async function runWrapper() {
|
||||
};
|
||||
const proxyBin = await getProxyBinaryPath(logger);
|
||||
await startProxy(proxyBin, proxyConfig, proxyLogFilePath, logger);
|
||||
await sendSuccessStatusReport(startedAt, logger);
|
||||
} catch (unwrappedError) {
|
||||
const error2 = wrapError(unwrappedError);
|
||||
core11.setFailed(`start-proxy action failed: ${error2.message}`);
|
||||
|
||||
@@ -89,6 +89,20 @@ function generateCertificateAuthority(): CertificateAuthority {
|
||||
return { cert: pem, key };
|
||||
}
|
||||
|
||||
async function sendSuccessStatusReport(startedAt: Date, logger: Logger) {
|
||||
const statusReportBase = await createStatusReportBase(
|
||||
ActionName.StartProxy,
|
||||
"success",
|
||||
startedAt,
|
||||
undefined,
|
||||
await util.checkDiskUsage(logger),
|
||||
logger,
|
||||
);
|
||||
if (statusReportBase !== undefined) {
|
||||
await sendStatusReport(statusReportBase);
|
||||
}
|
||||
}
|
||||
|
||||
async function runWrapper() {
|
||||
const startedAt = new Date();
|
||||
|
||||
@@ -132,6 +146,9 @@ async function runWrapper() {
|
||||
// Start the Proxy
|
||||
const proxyBin = await getProxyBinaryPath(logger);
|
||||
await startProxy(proxyBin, proxyConfig, proxyLogFilePath, logger);
|
||||
|
||||
// Report success if we have reached this point.
|
||||
await sendSuccessStatusReport(startedAt, logger);
|
||||
} catch (unwrappedError) {
|
||||
const error = util.wrapError(unwrappedError);
|
||||
core.setFailed(`start-proxy action failed: ${error.message}`);
|
||||
|
||||
Reference in New Issue
Block a user