Re-export codeql testing environment variable to subsequent steps, if set.
This commit is contained in:
parent
4b73c4f99e
commit
bfcbb093ac
6 changed files with 22 additions and 5 deletions
7
lib/actions-util.js
generated
7
lib/actions-util.js
generated
|
|
@ -502,7 +502,12 @@ async function createStatusReportBase(actionName, status, actionStartedAt, cause
|
||||||
const runnerOs = (0, util_1.getRequiredEnvParam)("RUNNER_OS");
|
const runnerOs = (0, util_1.getRequiredEnvParam)("RUNNER_OS");
|
||||||
const codeQlCliVersion = (0, util_1.getCachedCodeQlVersion)();
|
const codeQlCliVersion = (0, util_1.getCachedCodeQlVersion)();
|
||||||
const actionRef = process.env["GITHUB_ACTION_REF"];
|
const actionRef = process.env["GITHUB_ACTION_REF"];
|
||||||
const testingEnvironment = process.env["CODEQL_ACTION_TESTING_ENVIRONMENT"] || "";
|
const testingEnvironment = 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 = {
|
const statusReport = {
|
||||||
workflow_run_id: workflowRunID,
|
workflow_run_id: workflowRunID,
|
||||||
workflow_name: workflowName,
|
workflow_name: workflowName,
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
3
lib/shared-environment.js
generated
3
lib/shared-environment.js
generated
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.CODEQL_WORKFLOW_STARTED_AT = exports.ODASA_TRACER_CONFIGURATION = void 0;
|
exports.CODEQL_ACTION_TESTING_ENVIRONMENT = exports.CODEQL_WORKFLOW_STARTED_AT = exports.ODASA_TRACER_CONFIGURATION = void 0;
|
||||||
exports.ODASA_TRACER_CONFIGURATION = "ODASA_TRACER_CONFIGURATION";
|
exports.ODASA_TRACER_CONFIGURATION = "ODASA_TRACER_CONFIGURATION";
|
||||||
// The time at which the first action (normally init) started executing.
|
// The time at which the first action (normally init) started executing.
|
||||||
// If a workflow invokes a different action without first invoking the init
|
// If a workflow invokes a different action without first invoking the init
|
||||||
|
|
@ -8,4 +8,5 @@ exports.ODASA_TRACER_CONFIGURATION = "ODASA_TRACER_CONFIGURATION";
|
||||||
// then this variable will be assigned the start time of the action invoked
|
// then this variable will be assigned the start time of the action invoked
|
||||||
// rather that the init action.
|
// rather that the init action.
|
||||||
exports.CODEQL_WORKFLOW_STARTED_AT = "CODEQL_WORKFLOW_STARTED_AT";
|
exports.CODEQL_WORKFLOW_STARTED_AT = "CODEQL_WORKFLOW_STARTED_AT";
|
||||||
|
exports.CODEQL_ACTION_TESTING_ENVIRONMENT = "CODEQL_ACTION_TESTING_ENVIRONMENT";
|
||||||
//# sourceMappingURL=shared-environment.js.map
|
//# sourceMappingURL=shared-environment.js.map
|
||||||
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"shared-environment.js","sourceRoot":"","sources":["../src/shared-environment.ts"],"names":[],"mappings":";;;AAAa,QAAA,0BAA0B,GAAG,4BAA4B,CAAC;AACvE,wEAAwE;AACxE,2EAA2E;AAC3E,4EAA4E;AAC5E,2EAA2E;AAC3E,+BAA+B;AAClB,QAAA,0BAA0B,GAAG,4BAA4B,CAAC"}
|
{"version":3,"file":"shared-environment.js","sourceRoot":"","sources":["../src/shared-environment.ts"],"names":[],"mappings":";;;AAAa,QAAA,0BAA0B,GAAG,4BAA4B,CAAC;AACvE,wEAAwE;AACxE,2EAA2E;AAC3E,4EAA4E;AAC5E,2EAA2E;AAC3E,+BAA+B;AAClB,QAAA,0BAA0B,GAAG,4BAA4B,CAAC;AAE1D,QAAA,iCAAiC,GAC5C,mCAAmC,CAAC"}
|
||||||
|
|
@ -682,7 +682,15 @@ export async function createStatusReportBase(
|
||||||
const codeQlCliVersion = getCachedCodeQlVersion();
|
const codeQlCliVersion = getCachedCodeQlVersion();
|
||||||
const actionRef = process.env["GITHUB_ACTION_REF"];
|
const actionRef = process.env["GITHUB_ACTION_REF"];
|
||||||
const testingEnvironment =
|
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 = {
|
const statusReport: StatusReportBase = {
|
||||||
workflow_run_id: workflowRunID,
|
workflow_run_id: workflowRunID,
|
||||||
|
|
|
||||||
|
|
@ -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
|
// then this variable will be assigned the start time of the action invoked
|
||||||
// rather that the init action.
|
// rather that the init action.
|
||||||
export const CODEQL_WORKFLOW_STARTED_AT = "CODEQL_WORKFLOW_STARTED_AT";
|
export const CODEQL_WORKFLOW_STARTED_AT = "CODEQL_WORKFLOW_STARTED_AT";
|
||||||
|
|
||||||
|
export const CODEQL_ACTION_TESTING_ENVIRONMENT =
|
||||||
|
"CODEQL_ACTION_TESTING_ENVIRONMENT";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue