@@ -79,17 +79,15 @@ type TemplateContext = {
|
||||
each?: JsonValue;
|
||||
};
|
||||
|
||||
type CheckpointsState = {
|
||||
[key: string]:
|
||||
| {
|
||||
status: 'failed';
|
||||
reason: string;
|
||||
}
|
||||
| {
|
||||
status: 'success';
|
||||
value: JsonValue;
|
||||
};
|
||||
};
|
||||
type CheckpointState =
|
||||
| {
|
||||
status: 'failed';
|
||||
reason: string;
|
||||
}
|
||||
| {
|
||||
status: 'success';
|
||||
value: JsonValue;
|
||||
};
|
||||
|
||||
const isValidTaskSpec = (taskSpec: TaskSpec): taskSpec is TaskSpecV1beta3 => {
|
||||
return taskSpec.apiVersion === 'scaffolder.backstage.io/v1beta3';
|
||||
@@ -369,7 +367,9 @@ export class NunjucksWorkflowRunner implements WorkflowRunner {
|
||||
let prevValue: U | undefined;
|
||||
if (prevTaskState) {
|
||||
const prevState = (
|
||||
prevTaskState.state?.checkpoints as CheckpointsState
|
||||
prevTaskState.state?.checkpoints as {
|
||||
[key: string]: CheckpointState;
|
||||
}
|
||||
)?.[key];
|
||||
if (prevState && prevState.status === 'success') {
|
||||
prevValue = prevState.value as U;
|
||||
|
||||
Reference in New Issue
Block a user