File tree Expand file tree Collapse file tree 1 file changed +62
-0
lines changed
Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments