-
Notifications
You must be signed in to change notification settings - Fork 54
64 lines (62 loc) · 2.45 KB
/
labeler.yml
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
56
57
58
59
60
61
62
63
64
name: Label Issues
on:
issues:
types:
- reopened
- opened
jobs:
label_issues:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Check Issue Type
run: |
# Extract issue title and body
# Custom logic for label classification
if echo "${TITLE}" | grep -qiE "bug|error|issue|fix|"; then
echo "Adding **'bug'** label..."
gh issue edit "${NUMBER}" --add-label "bug"
fi
if echo "${TITLE}" | grep -qiE "chore|maintenance|cleanup|refactor"; then
echo "Adding **'chore'** label..."
gh issue edit "${NUMBER}" --add-label "chore"
fi
if echo "${TITLE}" | grep -qiE "documentation|docs|typo"; then
echo "Adding **'documentation'** label..."
gh issue edit "${NUMBER}" --add-label "documentation"
fi
if echo "${TITLE}" | grep -qiE "duplicate"; then
echo "Adding **'duplicate'** label..."
gh issue edit "${NUMBER}" --add-label "duplicate"
fi
if echo "${TITLE}" | grep -qiE "enhancement|feature|feat|property|attribute"; then
echo "Adding **'enhancement'** label..."
gh issue edit "${NUMBER}" --add-label "enhancement"
fi
if echo "${TITLE}" | grep -qiE "good first issue"; then
echo "Adding **'good first issue'** label..."
gh issue edit "${NUMBER}" --add-label "good first issue"
fi
if echo "${TITLE}" | grep -qiE "help wanted"; then
echo "Adding **'help wanted'** label..."
gh issue edit "${NUMBER}" --add-label "help wanted"
fi
if echo "${TITLE}" | grep -qiE "invalid"; then
echo "Adding **'invalid'** label..."
gh issue edit "${NUMBER}" --add-label "invalid"
fi
if echo "${TITLE}" | grep -qiE "question"; then
echo "Adding **'question'** label..."
gh issue edit "${NUMBER}" --add-label "question"
fi
if echo "${TITLE}" | grep -qiE "wontfix|won't fix"; then
echo "Adding **'wontfix'** label..."
gh issue edit "${NUMBER}" --add-label "wontfix"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUMBER: ${{ github.event.issue.number }}
TITLE: ${{ github.event.issue.title }}
BODY: ${{ github.event.issue.body }}
GH_REPO: ${{ github.repository }}