Merge pull request #498 from usual2970/hotfix/workflow

fix the issue where the deployment node could not set the certificate…
This commit is contained in:
Yoan.liu 2025-03-09 12:42:22 +08:00 committed by GitHub
commit 786f2f8678
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -436,11 +436,6 @@ export const getOutputBeforeNodeId = (root: WorkflowNode, nodeId: string, type:
return true;
}
// 如果当前节点是 ExecuteFailure清除 ExecuteResultBranch 节点前一个节点的输出
if (current.type === WorkflowNodeType.ExecuteFailure) {
output.splice(output.length - 1);
}
if (current.type !== WorkflowNodeType.Branch && current.outputs && current.outputs.some((io) => io.type === type)) {
output.push({
...current,
@ -449,8 +444,13 @@ export const getOutputBeforeNodeId = (root: WorkflowNode, nodeId: string, type:
}
if (isBranchLike(current)) {
const currentLength = output.length;
let currentLength = output.length;
const latestOutput = output.length > 0 ? output[output.length - 1] : null;
for (const branch of current.branches!) {
if (branch.type === WorkflowNodeType.ExecuteFailure) {
output.splice(output.length - 1);
currentLength -= 1;
}
if (traverse(branch, output)) {
return true;
}
@ -458,6 +458,10 @@ export const getOutputBeforeNodeId = (root: WorkflowNode, nodeId: string, type:
if (output.length > currentLength) {
output.splice(currentLength);
}
if (latestOutput && branch.type === WorkflowNodeType.ExecuteFailure) {
output.push(latestOutput);
currentLength += 1;
}
}
}