generated from NaverPayDev/ts-monorepo-template
-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (33 loc) · 1.22 KB
/
add-assignee.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
name: 'add assignee to pull request automatically'
on:
pull_request:
types: [ opened, ready_for_review, synchronize, reopened ]
branches:
- '**'
- '!main'
jobs:
ADD_ASSIGNEE_TO_PULL_REQUEST:
runs-on: ubuntu-latest
steps:
- name: Add Assignee to pr
uses: actions/github-script@v3
with:
script: |
try {
const result = await github.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.number,
})
console.log(result)
if (result.data.assignee === null) {
await github.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
assignees: context.actor,
})
}
} catch (err) {
console.error(`Check Pull Request Error ${err}`)
}