Skip to content

Commit 8e599c1

Browse files
authored
chore: assignee 자동 지정 (#7)
* chore: assignee 자동 지정 * chore: 에러 수정 * chore: test용 코드 삭제
1 parent b53ff07 commit 8e599c1

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

.github/workflows/auto-assignee.yml

+20-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
name: '[CI] PR Assignee 자동 지정'
22

3+
permissions:
4+
issues: write
5+
pull-requests: write
6+
37
on:
48
pull_request:
5-
types: [opened, synchronize]
9+
types: [opened, reopened]
610

711
jobs:
8-
assign-pr:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- name: Checkout repository
12-
uses: actions/checkout@v3
13-
14-
- name: Assign PR creator as assignee
15-
uses: actions-ecosystem/action-add-assignees@v1
16-
with:
17-
assignees: ${{ github.actor }}
18-
github_token: ${{ secrets.TOKEN }}
19-
12+
assign-pr:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Assign PR to the author
17+
uses: actions/github-script@v6
18+
with:
19+
script: |
20+
const prAuthor = context.payload.pull_request.user.login;
21+
github.rest.issues.addAssignees({
22+
owner: context.repo.owner,
23+
repo: context.repo.repo,
24+
issue_number: context.payload.pull_request.number,
25+
assignees: [prAuthor]
26+
})

0 commit comments

Comments
 (0)