Skip to content

Commit 1591680

Browse files
committed
Send a basic status report in start-proxy Action if it succeeds
1 parent cb5a284 commit 1591680

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

lib/start-proxy-action.js

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/start-proxy-action.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,20 @@ function generateCertificateAuthority(): CertificateAuthority {
8989
return { cert: pem, key };
9090
}
9191

92+
async function sendSuccessStatusReport(startedAt: Date, logger: Logger) {
93+
const statusReportBase = await createStatusReportBase(
94+
ActionName.StartProxy,
95+
"success",
96+
startedAt,
97+
undefined,
98+
await util.checkDiskUsage(logger),
99+
logger,
100+
);
101+
if (statusReportBase !== undefined) {
102+
await sendStatusReport(statusReportBase);
103+
}
104+
}
105+
92106
async function runWrapper() {
93107
const startedAt = new Date();
94108

@@ -132,6 +146,9 @@ async function runWrapper() {
132146
// Start the Proxy
133147
const proxyBin = await getProxyBinaryPath(logger);
134148
await startProxy(proxyBin, proxyConfig, proxyLogFilePath, logger);
149+
150+
// Report success if we have reached this point.
151+
await sendSuccessStatusReport(startedAt, logger);
135152
} catch (unwrappedError) {
136153
const error = util.wrapError(unwrappedError);
137154
core.setFailed(`start-proxy action failed: ${error.message}`);

0 commit comments

Comments
 (0)