-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (44 loc) · 1.35 KB
/
auto-label.yml
File metadata and controls
51 lines (44 loc) · 1.35 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
name: Auto Label PR
on:
pull_request:
types: [opened, edited]
jobs:
label:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read
steps:
- name: Add labels based on PR title
uses: actions/github-script@v7
with:
script: |
const title = context.payload.pull_request.title;
const labels = [];
// 주차별 문제인지 확인
if (title.includes('[Week')) {
labels.push('weekly-challenge');
}
// 개인 문제인지 확인
if (title.includes('[Personal]')) {
labels.push('personal');
}
// 플랫폼별 라벨
if (title.includes('BOJ')) {
labels.push('백준');
}
if (title.includes('PGS')) {
labels.push('프로그래머스');
}
if (title.includes('LTC') || title.includes('LeetCode')) {
labels.push('리트코드');
}
// 라벨 추가
if (labels.length > 0) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
labels: labels
});
}