chore: backport-candidate GitHub label (#10623)

* chore: backport-candidate GitHub label

* chore: sort label script

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Vlad Frangu
2025-01-18 09:22:50 +02:00
committed by GitHub
parent 21096884b1
commit 052ed7fbe7
5 changed files with 24 additions and 3 deletions

2
.github/labels.yml vendored
View File

@@ -10,6 +10,8 @@
color: 7ef7ef
- name: backport
color: 88aabb
- name: backport-candidate
color: 0075ca
- name: blocked
color: fc1423
- name: bug

View File

@@ -0,0 +1,2 @@
#!/usr/bin/env node
import('../dist/bin/sortLabels.mjs');

View File

@@ -0,0 +1,16 @@
import { readFile, writeFile } from 'node:fs/promises';
import { parse as parseYAML, stringify as stringifyYAML } from 'yaml';
interface LabelerData {
color: string;
name: string;
}
const labelsYamlFile = new URL('../../../../.github/labels.yml', import.meta.url);
const content = await readFile(labelsYamlFile, 'utf8');
const labelsYAML = parseYAML(content) as LabelerData[];
labelsYAML.sort((a, b) => a.name.localeCompare(b.name));
await writeFile(labelsYamlFile, stringifyYAML(labelsYAML));

View File

@@ -11,7 +11,8 @@
"fmt": "pnpm run format"
},
"bin": {
"generate-split-documentation": "./bin/generateSplitDocumentation.js"
"generate-split-documentation": "./bin/generateSplitDocumentation.js",
"sort-labels": "./bin/sortLabels.js"
},
"exports": {
".": {

View File

@@ -6,7 +6,7 @@ export default [
minify: 'terser',
}),
createTsupConfig({
entry: ['src/populateDevDatabaseBranch.ts'],
entry: ['src/populateDevDatabaseBranch.ts', 'bin/sortLabels.ts'],
format: 'esm',
minify: 'terser',
}),