Skip to content

Commit

Permalink
Re-export codeql testing environment variable to subsequent steps, if…
Browse files Browse the repository at this point in the history
… set.
  • Loading branch information
criemen committed Nov 1, 2022
1 parent 4b73c4f commit bfcbb09
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
7 changes: 6 additions & 1 deletion lib/actions-util.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/actions-util.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion lib/shared-environment.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/shared-environment.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion src/actions-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions src/shared-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

0 comments on commit bfcbb09

Please sign in to comment.