Actions status report: Send testing_environment.

The testing environment is taken from the environment variable
CODEQL_ACTION_TESTING_ENVIRONMENT.
This commit is contained in:
Cornelius Riemenschneider 2022-10-25 13:52:31 +02:00
parent 7e2585030f
commit 4b73c4f99e
3 changed files with 12 additions and 1 deletions

View file

@ -600,6 +600,12 @@ export interface StatusReportBase {
completed_at?: string;
/** State this action is currently in. */
status: ActionStatus;
/**
* Testing environment: Set if non-production environment.
* The server accepts one of the following values:
* ["", "qa-rc", "qa-rc-1", "qa-rc-2", "qa-experiment-1", "qa-experiment-2", "qa-experiment-3"].
*/
testing_environment: string;
/**
* Information about the enablement of the ML-powered JS query pack.
*
@ -675,6 +681,8 @@ export async function createStatusReportBase(
const runnerOs = getRequiredEnvParam("RUNNER_OS");
const codeQlCliVersion = getCachedCodeQlVersion();
const actionRef = process.env["GITHUB_ACTION_REF"];
const testingEnvironment =
process.env["CODEQL_ACTION_TESTING_ENVIRONMENT"] || "";
const statusReport: StatusReportBase = {
workflow_run_id: workflowRunID,
@ -689,6 +697,7 @@ export async function createStatusReportBase(
started_at: workflowStartedAt,
action_started_at: actionStartedAt.toISOString(),
status,
testing_environment: testingEnvironment,
runner_os: runnerOs,
action_version: pkg.version,
};