https://github.com/apps/cr-gpt

Untitled

→ 설치 후, 사용하고자 하는 계정 및 Repository 설정(공개 저장소, 비공개 저장소 선택) 후 계정 로그인 처리 까지 진행

원작자 사용법

GitHub - anc95/ChatGPT-CodeReview: 🐥 A code review bot powered by ChatGPT

OPEN_API Key 등록

Untitled

→ 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
                  
              

Github Action 실습