fix: Update config file to address labeller file changes (#10332)

fix: update label script
This commit is contained in:
Jiralite
2024-06-07 14:38:08 +01:00
committed by Vlad Frangu
parent 1bafba3fff
commit 728c2686bd
2 changed files with 70 additions and 23 deletions

View File

@@ -70,10 +70,17 @@ export default function generator(plop: PlopTypes.NodePlopAPI): void {
type: 'modify',
path: `${plop.getDestBasePath()}/../../.github/labeler.yml`,
transform(content, answers) {
const labelerYAML = parseYAML(content) as Record<string, string[]>;
labelerYAML[`packages:${answers.name}`] = [`packages/${answers.name}/*`, `packages/${answers.name}/**/*`];
const labelerYAML = parseYAML(content) as Record<string, Record<string, Record<string, string[]>[]>[]>;
return stringifyYAML(sortYAMLObject(labelerYAML));
labelerYAML[`packages:${answers.name}`] = [
{
'changed-files': [
{ 'any-glob-to-any-file': [`packages/${answers.name}/*`, `packages/${answers.name}/**/*`] },
],
},
];
return stringifyYAML(labelerYAML, { sortMapEntries: true });
},
},
{