Add check run ID

This commit is contained in:
Henry Mercer
2026-03-03 19:04:04 +01:00
parent a05f541a6e
commit 129d771399
4 changed files with 43 additions and 19 deletions
+11 -4
View File
@@ -274,10 +274,17 @@ async function recordOverlayStatus(
return;
}
const overlayStatus: OverlayStatus = createOverlayStatus({
attemptedToBuildOverlayBaseDatabase: true,
builtOverlayBaseDatabase: false,
});
const checkRunIdInput = actionsUtil.getOptionalInput("check-run-id");
const checkRunId =
checkRunIdInput !== undefined ? parseInt(checkRunIdInput, 10) : undefined;
const overlayStatus: OverlayStatus = createOverlayStatus(
{
attemptedToBuildOverlayBaseDatabase: true,
builtOverlayBaseDatabase: false,
},
Number.isNaN(checkRunId) ? undefined : checkRunId,
);
const diskUsage = await checkDiskUsage(logger);
if (diskUsage === undefined) {
+10 -5
View File
@@ -45,6 +45,8 @@ function getStatusFilePath(languages: string[]): string {
/** Details of the job that recorded an overlay status. */
interface JobInfo {
/** The check run ID. This is optional since it is not always available. */
checkRunId?: number;
/** The workflow run ID. */
workflowRunId: number;
/** The workflow run attempt number. */
@@ -66,14 +68,17 @@ export interface OverlayStatus {
/** Creates an `OverlayStatus` populated with the details of the current job. */
export function createOverlayStatus(
attributes: Omit<OverlayStatus, "job">,
checkRunId?: number,
): OverlayStatus {
const job: JobInfo = {
workflowRunId: getWorkflowRunID(),
workflowRunAttempt: getWorkflowRunAttempt(),
name: getRequiredEnvParam("GITHUB_JOB"),
...(checkRunId !== undefined && { checkRunId }),
};
return {
...attributes,
job: {
workflowRunId: getWorkflowRunID(),
workflowRunAttempt: getWorkflowRunAttempt(),
name: getRequiredEnvParam("GITHUB_JOB"),
},
job,
};
}