Skip to content

Commit 43c8329

Browse files
committed
feat: add: auto-labeling and assignee for PRs
1 parent 13fbcd6 commit 43c8329

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: PR 자동 라벨링 및 담당자 할당
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened]
6+
7+
jobs:
8+
add-labels-assign:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v2
13+
14+
- name: Add labels and assign PR creator
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
run: |
18+
PR_NUMBER=${{ github.event.pull_request.number }}
19+
PR_CREATOR=${{ github.event.pull_request.user.login }}
20+
21+
# Add labels
22+
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
23+
-H "Accept: application/vnd.github.v3+json" \
24+
https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/labels \
25+
-d '{"labels":["매운맛🔥", "진행 중 🏃"]}'
26+
27+
# Assign PR creator
28+
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
29+
-H "Accept: application/vnd.github.v3+json" \
30+
https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/assignees \
31+
-d "{\"assignees\":[\"$PR_CREATOR\"]}"

0 commit comments

Comments
 (0)