Re-export codeql testing environment variable to subsequent steps, if set.

This commit is contained in:
Cornelius Riemenschneider
2022-11-01 13:18:25 +01:00
parent 4b73c4f99e
commit bfcbb093ac
6 changed files with 22 additions and 5 deletions

View File

@@ -682,7 +682,15 @@ export async function createStatusReportBase(
const codeQlCliVersion = getCachedCodeQlVersion();
const actionRef = process.env["GITHUB_ACTION_REF"];
const testingEnvironment =
process.env["CODEQL_ACTION_TESTING_ENVIRONMENT"] || "";
process.env[sharedEnv.CODEQL_ACTION_TESTING_ENVIRONMENT] || "";
// re-export the testing environment variable so that it is available to subsequent steps,
// even if it was only set for this step
if (testingEnvironment !== "") {
core.exportVariable(
sharedEnv.CODEQL_ACTION_TESTING_ENVIRONMENT,
testingEnvironment
);
}
const statusReport: StatusReportBase = {
workflow_run_id: workflowRunID,

View File

@@ -5,3 +5,6 @@ export const ODASA_TRACER_CONFIGURATION = "ODASA_TRACER_CONFIGURATION";
// then this variable will be assigned the start time of the action invoked
// rather that the init action.
export const CODEQL_WORKFLOW_STARTED_AT = "CODEQL_WORKFLOW_STARTED_AT";
export const CODEQL_ACTION_TESTING_ENVIRONMENT =
"CODEQL_ACTION_TESTING_ENVIRONMENT";