Skip to content

Commit adf39dd

Browse files
committed
Add function for starting status report
1 parent ee753b4 commit adf39dd

File tree

2 files changed

+40
-22
lines changed

2 files changed

+40
-22
lines changed

lib/init-action.js

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

src/init-action.ts

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,31 @@ interface InitToolsDownloadFields {
9696
tools_feature_flags_valid?: boolean;
9797
}
9898

99+
/**
100+
* Sends a status report indicating that the `init` Action is starting.
101+
*
102+
* @param startedAt
103+
* @param config
104+
* @param logger
105+
*/
106+
async function sendStartingStatusReport(
107+
startedAt: Date,
108+
config: configUtils.Config | undefined,
109+
logger: Logger,
110+
) {
111+
const statusReportBase = await createStatusReportBase(
112+
ActionName.Init,
113+
"starting",
114+
startedAt,
115+
config,
116+
await checkDiskUsage(logger),
117+
logger,
118+
);
119+
if (statusReportBase !== undefined) {
120+
await sendStatusReport(statusReportBase);
121+
}
122+
}
123+
99124
async function sendCompletedStatusReport(
100125
startedAt: Date,
101126
config: configUtils.Config | undefined,
@@ -227,17 +252,7 @@ async function run() {
227252
);
228253

229254
try {
230-
const statusReportBase = await createStatusReportBase(
231-
ActionName.Init,
232-
"starting",
233-
startedAt,
234-
config,
235-
await checkDiskUsage(logger),
236-
logger,
237-
);
238-
if (statusReportBase !== undefined) {
239-
await sendStatusReport(statusReportBase);
240-
}
255+
await sendStartingStatusReport(startedAt, config, logger);
241256
const codeQLDefaultVersionInfo = await features.getDefaultCliVersion(
242257
gitHubVersion.type,
243258
);

0 commit comments

Comments
 (0)