Skip to content

Commit f13ff5c

Browse files
feat(createPackage): sort label files (#8892)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 5e43310 commit f13ff5c

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

.github/labeler.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ apps:guide:
44
apps:website:
55
- apps/website/*
66
- apps/website/**/*
7-
87
packages:brokers:
98
- packages/brokers/*
109
- packages/brokers/**/*

.github/labels.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
color: 0075ca
2121
- name: dependencies
2222
color: 276bd1
23-
- name: discussion
24-
color: b6b1f9
2523
- name: discord
2624
color: '5663e9'
25+
- name: discussion
26+
color: b6b1f9
2727
- name: documentation
2828
color: 0075ca
2929
- name: duplicate
@@ -40,12 +40,12 @@
4040
color: 4b1f8e
4141
- name: help wanted
4242
color: '008672'
43-
- name: interactions
44-
color: 80c042
4543
- name: in progress
4644
color: ffccd7
4745
- name: in review
4846
color: aed5fc
47+
- name: interactions
48+
color: 80c042
4949
- name: invalid
5050
color: e4e669
5151
- name: need repro

packages/scripts/src/createPackage.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,19 @@ export async function createPackage(packageName: string, packageDescription?: st
5858
const labelsYAML = parseYAML(await readFile('labels.yml', 'utf8')) as LabelerData[];
5959
labelsYAML.push({ name: `packages:${packageName}`, color: 'fbca04' });
6060

61+
labelsYAML.sort((a, b) => a.name.localeCompare(b.name));
62+
6163
await writeFile('labels.yml', stringifyYAML(labelsYAML));
6264

6365
const labelerYAML = parseYAML(await readFile('labeler.yml', 'utf8')) as Record<string, string[]>;
6466
labelerYAML[`packages:${packageName}`] = [`packages/${packageName}/*`, `packages/${packageName}/**/*`];
6567

66-
await writeFile('labeler.yml', stringifyYAML(labelerYAML));
68+
const sortedLabelerYAML: Record<string, string[]> = {};
69+
for (const key of Object.keys(labelerYAML).sort((a, b) => a.localeCompare(b))) {
70+
sortedLabelerYAML[key] = labelerYAML[key]!;
71+
}
72+
73+
await writeFile('labeler.yml', stringifyYAML(sortedLabelerYAML));
6774

6875
// Move back to root
6976
chdir('..');

0 commit comments

Comments
 (0)