Merge pull request #30317 from backstage/blam/actions-fix

`scaffolder-module-cookiecutter`: change the input types for `values`
This commit is contained in:
Ben Lambert
2025-06-19 14:06:01 +02:00
committed by GitHub
3 changed files with 16 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend-module-cookiecutter': patch
---
Fixing the typescript issue with using `z.unknown()`
@@ -4,10 +4,12 @@
```ts
import { BackendFeature } from '@backstage/backend-plugin-api';
import { objectOutputType } from 'zod';
import { ScmIntegrations } from '@backstage/integration';
import { TemplateAction } from '@backstage/plugin-scaffolder-node';
import { UrlReaderService } from '@backstage/backend-plugin-api';
import { Writable } from 'stream';
import { ZodTypeAny } from 'zod';
// @public
export interface ContainerRunner {
@@ -47,7 +49,7 @@ export function createFetchCookiecutterAction(options: {
}): TemplateAction<
{
url: string;
values: Record<string, unknown>;
values: objectOutputType<{}, ZodTypeAny, 'passthrough'>;
targetPath?: string | undefined;
copyWithoutRender?: string[] | undefined;
extensions?: string[] | undefined;
@@ -169,9 +169,14 @@ export function createFetchCookiecutterAction(options: {
})
.optional(),
values: z =>
z.record(z.unknown(), {
description: 'Values to pass on to cookiecutter for templating',
}),
z
.object(
{},
{
description: 'Values to pass on to cookiecutter for templating',
},
)
.passthrough(),
copyWithoutRender: z =>
z
.array(z.string(), {