Skip to content

Commit 1ac1fd7

Browse files
Gyuhyeok99claude
andcommitted
feat: GitHub 라벨 자동 생성 워크플로우 추가
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent cb8401c commit 1ac1fd7

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.github/workflows/setup-labels.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Setup Labels
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
setup-labels:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
issues: write
11+
12+
steps:
13+
- name: Create labels
14+
uses: actions/github-script@v7
15+
with:
16+
script: |
17+
const labels = [
18+
{
19+
name: 'weekly-challenge',
20+
color: '0052CC',
21+
description: '주차별 공통 문제'
22+
},
23+
{
24+
name: 'personal',
25+
color: '0E8A16',
26+
description: '개인 자유 문제'
27+
},
28+
{
29+
name: '백준',
30+
color: '5319E7',
31+
description: '백준 문제'
32+
},
33+
{
34+
name: '프로그래머스',
35+
color: 'D93F0B',
36+
description: '프로그래머스 문제'
37+
},
38+
{
39+
name: '리트코드',
40+
color: 'B60205',
41+
description: '리트코드 문제'
42+
}
43+
];
44+
45+
for (const label of labels) {
46+
try {
47+
await github.rest.issues.createLabel({
48+
owner: context.repo.owner,
49+
repo: context.repo.repo,
50+
name: label.name,
51+
color: label.color,
52+
description: label.description
53+
});
54+
console.log(`✅ Created label: ${label.name}`);
55+
} catch (error) {
56+
if (error.status === 422) {
57+
console.log(`⚠️ Label already exists: ${label.name}`);
58+
} else {
59+
console.error(`❌ Error creating label ${label.name}:`, error);
60+
}
61+
}
62+
}

0 commit comments

Comments
 (0)