Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: backport-candidate GitHub label #10623

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
color: 7ef7ef
- name: backport
color: 88aabb
- name: backport-candidate
color: 0075ca
- name: blocked
color: fc1423
- name: bug
Expand Down
2 changes: 2 additions & 0 deletions packages/scripts/bin/sortLabels.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env node
import('../dist/bin/sortLabels.mjs');
16 changes: 16 additions & 0 deletions packages/scripts/bin/sortLabels.ts
Original file line number Diff line number Diff line change
@@ -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));
5 changes: 3 additions & 2 deletions packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
"description": "A set of scripts that we use for our workflows",
"private": true,
"scripts": {
"build": "tsc --noEmit --lib ESNext,DOM && tsup",
"build": "tsc --noEmit --lib ESNext,DOM && tsup",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src turbo/generators/config.ts",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src turbo/generators/config.ts",
"fmt": "pnpm run format"
},
"bin": {
"generate-split-documentation": "./bin/generateSplitDocumentation.js"
"generate-split-documentation": "./bin/generateSplitDocumentation.js",
"sort-labels": "./bin/sortLabels.js"
},
"exports": {
".": {
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default [
minify: 'terser',
}),
createTsupConfig({
entry: ['src/populateDevDatabaseBranch.ts'],
entry: ['src/populateDevDatabaseBranch.ts', 'bin/sortLabels.ts'],
format: 'esm',
minify: 'terser',
}),
Expand Down