Git

Github auto_assign 설정

chemi_ 2022. 10. 13. 16:03

Github를 이용해서 팀 프로젝트를 할 때 Pull Request를 생성하면 자동으로 코드리뷰어를 설정해주는 CI입니다.

 

1. 아래 사이트에 들어가서 Add to Github 버튼을 누릅니다.

 

https://probot.github.io/apps/auto-assign/

 

https://probot.github.io/apps/auto-assign/

What it does Auto Assign adds reviewers/assignees to pull requests when pull requests are opened. How it works When the pull request is opened, automatically add reviewers/assignees to the pull request.If the number of reviewers/assignees is specified, ran

probot.github.io

2. 추가할 organigation을 선택합니다

 

3. 추가할 repository를 검색 후 추가합니다.

 

4. 목록에 추가된 걸 확인합니다.

 

5. Update access를 눌러 업데이트 합니다.

6. 깃허브에 auto_assign.yml 파일을 추가합니다. (택 1)

6-1. 깃허브 웹에서 바로 추가하는 방법

Create new file을 누르고

 

직접 auto_assign.yml 이라는 파일을 만들고 내부에 코드를 추가합니다 (파일명 중요!)

# Set to true to add reviewers to pull requests
addReviewers: true

# Set to true to add assignees to pull requests
addAssignees: false

# A list of reviewers to be added to pull requests (GitHub user name)
reviewers:
  - MMMIIIN (예시)
  - 팀원의 깃허브 닉네임
  - 팀원의 깃허브 닉네임
  - 팀원의 깃허브 닉네임
  - 팀원의 깃허브 닉네임
# A list of keywords to be skipped the process that add reviewers if pull requests include it 
skipKeywords:
  - wip

# A number of reviewers added to the pull request
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 0

 

커밋합니다

 

6-2. local 폴더에서 추가하고 push 하는 방법

1. 해당 폴더를 열어줍니다 (초기 세팅중이라 아무것도 없음)

2. Shift + Command + . 눌러서 숨김파일을 보이게 합니다.

미리 추가하고 작성하는거라 살짝 지웠습니다 ^______^

 

3. auto_assign.yml 파일을 만듭니다 (파일명 중요!)

4. 내부에 코드를 작성합니다.

# Set to true to add reviewers to pull requests
addReviewers: true

# Set to true to add assignees to pull requests
addAssignees: false

# A list of reviewers to be added to pull requests (GitHub user name)
reviewers:
  - MMMIIIN (예시)
  - 팀원의 깃허브 닉네임
  - 팀원의 깃허브 닉네임
  - 팀원의 깃허브 닉네임
  - 팀원의 깃허브 닉네임
# A list of keywords to be skipped the process that add reviewers if pull requests include it 
skipKeywords:
  - wip

# A number of reviewers added to the pull request
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 0

+) 팀원의 깃허브 닉네임 보기

없다면 

주소창의 요 부분입니다 ^_______^

 

5. 생성 완료

 

6. 커밋합니다

untracked 파일이기 때문에 

$ git add * 

명령어가 먹질 않습니다

그래서

$ git add .github/auto_assign.yml

 

직접 add해야합니다.

 

7. 원격에 push 합니다.

8. 설정 완료 !