Skip to content

Commit d737ebe

Browse files
authored
Migrate from deprecated github-label-sync to @endbug/github-label-sync (#323)
* Initial plan * Migrate from github-label-sync to @endbug/github-label-sync Agent-Logs-Url: https://github.com/EndBug/label-sync/sessions/de132f6d-cd7b-4edd-88f7-fff8672081ab --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent d3013d0 commit d737ebe

5 files changed

Lines changed: 184 additions & 149 deletions

File tree

lib/index.js

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 115 additions & 135 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@
2424
"homepage": "https://github.com/EndBug/label-sync#readme",
2525
"dependencies": {
2626
"@actions/core": "^1.10.1",
27+
"@endbug/github-label-sync": "^3.0.0",
2728
"axios": "^1.15.2",
28-
"github-label-sync": "^2.3.1",
2929
"js-yaml": "^4.1.1",
3030
"pretty-error": "^4.0.0"
3131
},
3232
"devDependencies": {
33-
"@types/github-label-sync": "^2.3.3",
3433
"@types/js-yaml": "^4.0.9",
3534
"@types/node": "^24.0.0",
3635
"@typescript-eslint/eslint-plugin": "^8.56.1",
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
declare module '@endbug/github-label-sync' {
2+
export interface BasicLabel {
3+
name: string;
4+
color: string;
5+
description?: string | undefined;
6+
}
7+
8+
export interface LabelInfo extends BasicLabel {
9+
aliases?: string[] | undefined;
10+
delete?: boolean | undefined;
11+
}
12+
13+
export interface OptionsBase {
14+
allowAddedLabels?: boolean | undefined;
15+
dryRun?: boolean | undefined;
16+
format?:
17+
| {
18+
diff?: ((str: string) => string) | undefined;
19+
success?: ((str: string) => string) | undefined;
20+
warning?: ((str: string) => string) | undefined;
21+
}
22+
| undefined;
23+
labels: LabelInfo[];
24+
log?:
25+
| {
26+
info?: ((str: string) => void) | undefined;
27+
warn?: ((str: string) => void) | undefined;
28+
}
29+
| undefined;
30+
}
31+
32+
export interface Options extends OptionsBase {
33+
accessToken: string;
34+
repo: string;
35+
endpoint?: string | undefined;
36+
}
37+
38+
export interface DefaultOptions extends Required<OptionsBase> {
39+
accessToken: null;
40+
endpoint: null;
41+
repo: null;
42+
}
43+
44+
export interface LabelDiff {
45+
name: string;
46+
type: string;
47+
actual?: BasicLabel | undefined;
48+
expected?: BasicLabel | undefined;
49+
}
50+
51+
export const defaults: DefaultOptions;
52+
53+
export default function githubLabelSync(
54+
options: Options
55+
): Promise<LabelDiff[]>;
56+
}

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as PrettyError from 'pretty-error';
22
PrettyError.start();
33

44
import * as core from '@actions/core';
5-
import githubLabelSync, {LabelInfo, Options} from 'github-label-sync';
5+
import githubLabelSync, {LabelInfo, Options} from '@endbug/github-label-sync';
66
import * as fs from 'fs';
77
import * as path from 'path';
88
import * as yaml from 'js-yaml';

0 commit comments

Comments
 (0)