Merge pull request #30706 from adrian-321/master

Fixed bug in the customProperties type
This commit is contained in:
Ben Lambert
2025-08-11 10:26:07 +02:00
committed by GitHub
6 changed files with 14 additions and 9 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend-module-github': patch
---
Fixed bug in the `customProperties` type which was preventing it being used to set a list of values against a key (e.g. for multi-select fields)
@@ -267,7 +267,7 @@ export function createGithubRepoCreateAction(options: {
| undefined;
requiredCommitSigning?: boolean | undefined;
requiredLinearHistory?: boolean | undefined;
customProperties?: Record<string, string> | undefined;
customProperties?: Record<string, string | string[]> | undefined;
subscribe?: boolean | undefined;
},
{
@@ -426,7 +426,7 @@ export function createPublishGithubAction(options: {
| undefined;
requiredCommitSigning?: boolean | undefined;
requiredLinearHistory?: boolean | undefined;
customProperties?: Record<string, string> | undefined;
customProperties?: Record<string, string | string[]> | undefined;
subscribe?: boolean | undefined;
},
{
@@ -330,7 +330,7 @@ describe('publish:github', () => {
...mockContext.input,
customProperties: {
foo: 'bar',
foo2: 'bar2',
foo2: ['bar2', 'bar3'],
},
},
});
@@ -505,7 +505,7 @@ describe('publish:github', () => {
...mockContext.input,
customProperties: {
foo: 'bar',
foo2: 'bar2',
foo2: ['bar2', 'bar3'],
},
},
});
@@ -279,7 +279,7 @@ describe('github:repo:create', () => {
...mockContext.input,
customProperties: {
foo: 'bar',
foo2: 'bar2',
foo2: ['bar2', 'bar3'],
},
},
});
@@ -455,7 +455,7 @@ describe('github:repo:create', () => {
...mockContext.input,
customProperties: {
foo: 'bar',
foo2: 'bar2',
foo2: ['bar2', 'bar3'],
},
},
});
@@ -75,7 +75,7 @@ export async function createGithubRepoWithCollaboratorsAndTopics(
includeClaimKeys?: string[];
}
| undefined,
customProperties: { [key: string]: string } | undefined,
customProperties: { [key: string]: string | string[] } | undefined,
subscribe: boolean | undefined,
logger: LoggerService,
) {
@@ -385,9 +385,9 @@ const oidcCustomization = (z: typeof zod) =>
const customProperties = (z: typeof zod) =>
z
.record(z.string(), {
.record(z.union([z.string(), z.array(z.string())]), {
description:
'Custom properties to be added to the repository (note, this only works for organization repositories)',
'Custom properties to be added to the repository (note, this only works for organization repositories). All values must be strings',
})
.optional();