diff --git a/plugins/scaffolder-backend/src/lib/templating/SecureTemplater.test.ts b/plugins/scaffolder-backend/src/lib/templating/SecureTemplater.test.ts index 2957848279..cd9eedcd96 100644 --- a/plugins/scaffolder-backend/src/lib/templating/SecureTemplater.test.ts +++ b/plugins/scaffolder-backend/src/lib/templating/SecureTemplater.test.ts @@ -36,9 +36,21 @@ describe('SecureTemplater', () => { test: 'my-value', }), ).toThrow(/expected name as lookup value, got ./); + dispose(); + + expect(() => render('${{ test }}', { test: 'my-value' })).toThrow( + /disposed/i, + ); }); + it('should allow dispose to be called more than once', async () => { + const { dispose } = await SecureTemplater.loadRenderer(); + + dispose(); + + expect(() => dispose()).not.toThrow(); + }); it('should make cookiecutter compatibility available when requested', async () => { const { render: renderWith, dispose: disposeWith } = await SecureTemplater.loadRenderer({ diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts index 57c829a499..28667ed9f2 100644 --- a/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts +++ b/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts @@ -365,8 +365,7 @@ export class NunjucksWorkflowRunner implements WorkflowRunner { )) ?? {}; taskLogger.info( - `Running ${action.id - } in dry-run mode with inputs (secrets redacted): ${JSON.stringify( + `Running ${action.id} in dry-run mode with inputs (secrets redacted): ${JSON.stringify( debugInput, undefined, 2, @@ -436,8 +435,7 @@ export class NunjucksWorkflowRunner implements WorkflowRunner { continue; } - const actionId = `${action.id}${iteration.each ? `[${iteration.each.key}]` : '' - }`; + const actionId = `${action.id}${iteration.each ? `[${iteration.each.key}]` : ''}`; if (action.schema?.input) { const validateResult = validateJsonSchema(