Skip to content

Commit

Permalink
chore: assignee 자동 지정 (#7)
Browse files Browse the repository at this point in the history
* chore: assignee 자동 지정

* chore: 에러 수정

* chore: test용 코드 삭제
  • Loading branch information
MOBUMIN authored Oct 6, 2024
1 parent b53ff07 commit 8e599c1
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions .github/workflows/auto-assignee.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
name: '[CI] PR Assignee 자동 지정'

permissions:
issues: write
pull-requests: write

on:
pull_request:
types: [opened, synchronize]
types: [opened, reopened]

jobs:
assign-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Assign PR creator as assignee
uses: actions-ecosystem/action-add-assignees@v1
with:
assignees: ${{ github.actor }}
github_token: ${{ secrets.TOKEN }}

assign-pr:
runs-on: ubuntu-latest

steps:
- name: Assign PR to the author
uses: actions/github-script@v6
with:
script: |
const prAuthor = context.payload.pull_request.user.login;
github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
assignees: [prAuthor]
})

0 comments on commit 8e599c1

Please sign in to comment.