Skip to content

Commit

Permalink
Update : PR 생성 자동화 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
unchaptered committed Jan 31, 2024
1 parent 6729146 commit 9272fd4
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions scripts/auto-pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def getPullRequestTemplate(
print(out)

pullRequestBody = f"""
[제목] [가제] 변경 필요
[제목] N월 N주차 회고
[기여자] {','.join(commiterList)}
[내용]
Expand Down Expand Up @@ -111,7 +111,7 @@ def getPullRequestTemplate(
labelList = list(set(labelList))

githubPrTemplate: GitHubPrTemplate = {
'title': '[가제] 변경 필요',
'title': 'N월 N주차 회고',
'body': pullRequestBody,
'labelList': labelList,
'assigneeList': commiterList
Expand Down Expand Up @@ -183,7 +183,7 @@ def updatePullRequest(
hasAssignee = len(assigneeList) > 0
if hasAssignee:
assignee = TK.join(assigneeList)
splitedCommand.extend(['--add-assignee', 'unchaptered'])
splitedCommand.extend(['--add-assignee', assignee])

isSuccess, outStr, errStr = splitRunner(splitedCommand=splitedCommand)
print('outStr : ', outStr)
Expand Down Expand Up @@ -228,31 +228,30 @@ def createPullRequest(

if __name__ == '__main__':
import sys

if len(sys.argv) == 1:
raise ValueError(f'python ./scripts/{sys.argv[0]} <base> <head>에서 base가 누락되었습니다.')
raise ValueError(
f'python ./scripts/{sys.argv[0]} <base> <head>에서 base가 누락되었습니다.')
if len(sys.argv) == 2:
raise ValueError(f'python ./scripts/{sys.argv[0]} <base> <head>에서 head가 누락되었습니다.')

raise ValueError(
f'python ./scripts/{sys.argv[0]} <base> <head>에서 head가 누락되었습니다.')

base = sys.argv[1]
head = sys.argv[2]

base = base
head = head

# fetchGitHub(base=base,
# head=head)
hasPr, prList = isExistsPrList(base=base,
head=head,
jsonFormat='number,title')
head=head,
jsonFormat='number,title')
requestTemplate = getPullRequestTemplate(base=base,
head=head)
head=head)

if hasPr:
updatePullRequest(prList=prList,
githubPrTemplate=requestTemplate)
githubPrTemplate=requestTemplate)

else:
createPullRequest(base=base,
head=head,
githubPrTemplate=requestTemplate)

head=head,
githubPrTemplate=requestTemplate)

0 comments on commit 9272fd4

Please sign in to comment.