mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
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:
2
packages/scripts/bin/sortLabels.js
Executable file
2
packages/scripts/bin/sortLabels.js
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
import('../dist/bin/sortLabels.mjs');
|
||||
16
packages/scripts/bin/sortLabels.ts
Normal file
16
packages/scripts/bin/sortLabels.ts
Normal 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));
|
||||
Reference in New Issue
Block a user