mirror of
https://github.com/github/codeql-action.git
synced 2026-04-26 16:58:47 +00:00
Add check run ID
This commit is contained in:
@@ -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
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user