Replace deprecated functions in init-action.post.ts

This commit is contained in:
Michael B. Gale
2026-10-12 11:29:29 +01:00
parent 0a9e57aaa3
commit b5ce898d79
2 changed files with 25 additions and 20 deletions

18
lib/entry-points.js generated
View File

@@ -187255,7 +187255,7 @@ async function run4(action) {
repositoryNwo,
features,
jobStatus2,
getEnv(),
action.env,
logger2
);
if (await isAnalyzingDefaultBranch() && hasConfigKey(config, "dependencyCachingEnabled") && config.dependencyCachingEnabled !== "none" /* None */) {
@@ -187280,7 +187280,7 @@ async function run4(action) {
}
return;
}
const jobStatus = getFinalJobStatus(config);
const jobStatus = getFinalJobStatus(action, config);
logger2.info(`CodeQL job status was ${getJobStatusDisplayName(jobStatus)}.`);
const statusReportBase = await createStatusReportBase(
action.name,
@@ -187302,25 +187302,25 @@ async function run4(action) {
logger2.info("Status report sent for init-post step.");
}
}
function getFinalJobStatus(config) {
const existingJobStatus = getJobStatusFromEnvironment();
function getFinalJobStatus(action, config) {
const existingJobStatus = getJobStatusFromEnvironment(action.env);
if (existingJobStatus !== void 0) {
return existingJobStatus;
}
let jobStatus;
if (process.env["CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY" /* ANALYZE_DID_COMPLETE_SUCCESSFULLY */] === "true") {
exportEnvVar("CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, "JOB_STATUS_SUCCESS" /* SuccessStatus */);
if (action.env.getOptional("CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY" /* ANALYZE_DID_COMPLETE_SUCCESSFULLY */) === "true") {
action.env.export("CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, "JOB_STATUS_SUCCESS" /* SuccessStatus */);
jobStatus = "JOB_STATUS_SUCCESS" /* SuccessStatus */;
} else if (config !== void 0) {
jobStatus = "JOB_STATUS_CONFIGURATION_ERROR" /* ConfigErrorStatus */;
} else {
jobStatus = "JOB_STATUS_UNKNOWN" /* UnknownStatus */;
}
exportEnvVar("CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, jobStatus);
action.env.export("CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, jobStatus);
return jobStatus;
}
function getJobStatusFromEnvironment() {
const jobStatusFromEnvironment = process.env["CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */];
function getJobStatusFromEnvironment(env) {
const jobStatusFromEnvironment = env.getOptional("CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */);
if (jobStatusFromEnvironment !== void 0) {
if (Object.values(JobStatus).includes(jobStatusFromEnvironment)) {
return jobStatusFromEnvironment;