https://github.com/apps/cr-gpt
→ 설치 후, 사용하고자 하는 계정 및 Repository 설정(공개 저장소, 비공개 저장소 선택) 후 계정 로그인 처리 까지 진행
원작자 사용법
GitHub - anc95/ChatGPT-CodeReview: 🐥 A code review bot powered by ChatGPT
OPEN_API Key 등록
해당 플로그인을 적용할 프로젝트로 이동 후 settings
탭으로 이동
좌측 Secrets and variables
의 action
탭 클릭 하여 등록 페이지 이동
발급 받은 Key를 Variables
에 등록
→ KEY 이름은 OPENAI_API_KEY 라고 해야함
name: test-github-action
permissions:
contents: read
pull-requests: write
on:
push:
branches: ['main', 'dev/main']
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
- name: Grant execute permission to gradlew
run: chmod +x ./gradlew
shell: bash
- name: Build with Gradle
run: ./gradlew build
shell: bash
- name: Get current time
uses: 1466587594/get-current-time@v2
id: current-time
with:
format: 'yyyy-MM-dd HH:mm:ss'
utcOffset: '+09:00'
- name: Show Current Time
run: echo "Current Time: ${{ steps.current-time.outputs.time }}"
shell: bash
- name: ChatGPT codeReviewer
uses: anc95/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# Optional
LANGUAGE: Korean
OPENAI_API_ENDPOINT: <https://api.openai.com/v1>
MODEL: gpt-3.5-turbo
PROMPT: Please check if there are any confusions or irregularities in the following code diff
top_p: 1
max_tokens: 100
MAX_PATCH_LENGTH: 10000
main
혹은 dev/main
브랜치에서 push가 일어나면 해당 yml 실행