Add steady_state_default_setup as field to base status report (#2305)

This will help us distinguish steady-state runs in default setup mode from advanced setup runs and default setup validation/onboarding runs.
This commit is contained in:
Angela P Wen
2024-05-23 00:47:59 +02:00
committed by GitHub
parent b1bd8da5e7
commit acdf23828a
6 changed files with 11 additions and 2 deletions

View File

@@ -75,6 +75,7 @@ test("createStatusReportBase", async (t) => {
t.is(statusReport.runner_os, process.env["RUNNER_OS"]!);
t.is(statusReport.started_at, process.env[EnvVar.WORKFLOW_STARTED_AT]!);
t.is(statusReport.status, "failure");
t.is(statusReport.steady_state_default_setup, false);
t.is(statusReport.workflow_name, process.env["GITHUB_WORKFLOW"] || "");
t.is(statusReport.workflow_run_attempt, 2);
t.is(statusReport.workflow_run_id, 100);

View File

@@ -143,6 +143,8 @@ export interface StatusReportBase {
started_at: string;
/** State this action is currently in. */
status: ActionStatus;
/** Whether this run is part of a steady-state, and not new, default setup run. */
steady_state_default_setup: boolean;
/**
* Testing environment: Set if non-production environment.
* The server accepts one of the following values:
@@ -270,6 +272,8 @@ export async function createStatusReportBase(
if (testingEnvironment !== "") {
core.exportVariable(EnvVar.TESTING_ENVIRONMENT, testingEnvironment);
}
const isSteadyStateDefaultSetupRun =
process.env["CODE_SCANNING_IS_STEADY_STATE_DEFAULT_SETUP"] === "true";
const statusReport: StatusReportBase = {
action_name: actionName,
@@ -287,6 +291,7 @@ export async function createStatusReportBase(
runner_os: runnerOs,
started_at: workflowStartedAt,
status,
steady_state_default_setup: isSteadyStateDefaultSetupRun,
testing_environment: testingEnvironment,
workflow_name: workflowName,
workflow_run_attempt: workflowRunAttempt,