-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (48 loc) ยท 2.21 KB
/
setup-label.yaml
File metadata and controls
55 lines (48 loc) ยท 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Setup Labels
on:
workflow_dispatch:
jobs:
setup-labels:
runs-on: ubuntu-latest
steps:
- name: Setup Default Labels
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const labels = [
{ name: "Priority: High ๐ฅ", description: '์ฐ์ ์์ ๋์', color: "F9D0C4" },
{ name: "Priority: Low ๐ข", description: '์ฐ์ ์์ ๋ฎ์', color: "C2E0C6" },
{ name: "Priority: Medium :bookmark:", description: '์ฐ์ ์์ ๋ณดํต', color: "FEF2C0" },
{ name: "Type: Doc :memo:", description: '๋ฌธ์ ์ถ๊ฐ / ์์ ', color: "0075ca" },
{ name: "Type: Bug :bug:", description: '๋ฒ๊ทธ', color: "d73a4a" },
{ name: "Type: Feature :sparkles:", description: '์ ๊ท ๊ธฐ๋ฅ', color: "AB5D19" },
{ name: "Type: Improve UX :arrow_up:", description: 'UX ๊ฐ์ ', color: "2CE151" },
{ name: "Type: Merge :truck:", description: '๋จธ์ง', color: "4A7A8F" },
{ name: "Type: Refactor :recycle:", description: '๋ฆฌํฉํ ๋ง', color: "027B6B" },
];
// ์กด์ฌํ๋ ๋ชจ๋ ๋ ์ด๋ธ ๋์ด
const listResponse = await github.rest.issues.listLabelsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
});
// ๋์ด๋ ๊ฐ ๋ ์ด๋ธ์ ๋ํด ์ญ์ ์์ฒญ
for (const label of listResponse.data) {
await github.rest.issues.deleteLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: label.name,
});
console.log(`Label '${label.name}' deleted.`);
}
// ์๋ก์ด ๋ ์ด๋ธ ์์ฑ
for (const label of labels) {
const response = await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: label.name,
color: label.color,
description: label.description,
});
console.log(`Label ${label.name} processed`, response.status);
}