Split up getFinalJobStatus

This commit is contained in:
Henry Mercer
2026-01-27 14:30:42 +00:00
parent 60b658ed10
commit b333fc6f5b
2 changed files with 44 additions and 16 deletions
+13 -6
View File
@@ -132967,12 +132967,9 @@ async function run2(startedAt) {
}
}
function getFinalJobStatus(config) {
const jobStatusFromEnvironment = process.env["CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */];
if (jobStatusFromEnvironment !== void 0) {
if (Object.values(JobStatus).includes(jobStatusFromEnvironment)) {
return jobStatusFromEnvironment;
}
return "JOB_STATUS_UNKNOWN" /* UnknownStatus */;
const existingJobStatus = getJobStatusFromEnvironment();
if (existingJobStatus !== void 0) {
return existingJobStatus;
}
let jobStatus;
if (process.env["CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY" /* ANALYZE_DID_COMPLETE_SUCCESSFULLY */] === "true") {
@@ -132986,6 +132983,16 @@ function getFinalJobStatus(config) {
core16.exportVariable("CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, jobStatus);
return jobStatus;
}
function getJobStatusFromEnvironment() {
const jobStatusFromEnvironment = process.env["CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */];
if (jobStatusFromEnvironment !== void 0) {
if (Object.values(JobStatus).includes(jobStatusFromEnvironment)) {
return jobStatusFromEnvironment;
}
return "JOB_STATUS_UNKNOWN" /* UnknownStatus */;
}
return void 0;
}
async function runWrapper() {
const startedAt = /* @__PURE__ */ new Date();
const logger = getActionsLogger();