Merge pull request #112 from SanjulaGanepola/fix/matrix-job-status

Fix matrix job for when workflow jobs have no name
This commit is contained in:
Sanjula Ganepola
2024-12-10 00:09:14 -05:00
committed by GitHub

View File

@@ -455,15 +455,15 @@ export class Act {
if (parsedMessage.jobID in commandArgs.workflow.yaml.jobs && commandArgs.workflow.yaml.jobs[parsedMessage.jobID].name) { if (parsedMessage.jobID in commandArgs.workflow.yaml.jobs && commandArgs.workflow.yaml.jobs[parsedMessage.jobID].name) {
// Use the name set for the job by the user // Use the name set for the job by the user
jobName = commandArgs.workflow.yaml.jobs[parsedMessage.jobID].name; jobName = commandArgs.workflow.yaml.jobs[parsedMessage.jobID].name;
// Update name if it is a matrix
if (parsedMessage.matrix && Object.keys(parsedMessage.matrix).length > 0) {
const matrixValues = Object.values(parsedMessage.matrix).join(", ");
jobName = `${jobName} (${matrixValues})`;
}
} }
} catch (error: any) { } } catch (error: any) { }
// Update name if it is a matrix
if (parsedMessage.matrix && Object.keys(parsedMessage.matrix).length > 0) {
const matrixValues = Object.values(parsedMessage.matrix).join(", ");
jobName = `${jobName} (${matrixValues})`;
}
let jobIndex = this.historyManager.workspaceHistory[commandArgs.path][historyIndex].jobs! let jobIndex = this.historyManager.workspaceHistory[commandArgs.path][historyIndex].jobs!
.findIndex(job => job.name === jobName); .findIndex(job => job.name === jobName);
if (jobIndex < 0) { if (jobIndex < 0) {