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

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));