Send a basic status report in start-proxy Action if it succeeds

This commit is contained in:
Michael B. Gale
2025-10-01 15:55:20 +01:00
parent cb5a2849ac
commit 15916800df
2 changed files with 31 additions and 0 deletions
+14
View File
@@ -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}`);
+17
View File
@@ -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}`);