diff --git a/.changeset/kind-dancers-boil.md b/.changeset/kind-dancers-boil.md index 8e69e830df..4451cab4f4 100644 --- a/.changeset/kind-dancers-boil.md +++ b/.changeset/kind-dancers-boil.md @@ -2,4 +2,4 @@ '@backstage/plugin-scaffolder-backend': patch --- -Added a documentation how to use checkpoints + the fix when to clean the workspace +Added a documentation how to use checkpoints diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts index 69f17e9dce..3b88fd0f10 100644 --- a/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts +++ b/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts @@ -508,11 +508,11 @@ export class NunjucksWorkflowRunner implements WorkflowRunner { const output = this.render(task.spec.output, context, renderTemplate); await taskTrack.markSuccessful(); - await task.cleanWorkspace?.(); return { output }; } finally { if (workspacePath) { + await task.cleanWorkspace?.(); await fs.remove(workspacePath); } } @@ -554,13 +554,10 @@ function scaffoldingTracker() { step: TaskStep, action: TemplateAction, ) { - await task.emitLog( - `Skipping because ${action.id} does not support dry-run`, - { - stepId: step.id, - status: 'skipped', - }, - ); + task.emitLog(`Skipping because ${action.id} does not support dry-run`, { + stepId: step.id, + status: 'skipped', + }); } async function markSuccessful() {