forked from codeit-sprint-fullstack/3-sprint-mission-fe
-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (26 loc) · 1.05 KB
/
auto-label-assign.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
name: PR 자동 라벨링 및 담당자 할당
on:
pull_request:
types: [opened, reopened]
jobs:
add-labels-assign:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Add labels and assign PR creator
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
PR_CREATOR=${{ github.event.pull_request.user.login }}
# Add labels
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/labels \
-d '{"labels":["매운맛🔥", "진행 중 🏃"]}'
# Assign PR creator
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/assignees \
-d "{\"assignees\":[\"$PR_CREATOR\"]}"