Skip to content

Customer UI front

Customer UI front #13

Workflow file for this run

name: 'Code Review GPT'
# Comentários para descrição e autor
# Descrição: Reviews the staged files with a GPT model from OpenAI
# Autor: Skynance
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
issues: write
pull-requests: write
jobs:
code-review:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # Isso assegura que todo o histórico do repositório é buscado
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 18
- name: Install Code Review GPT
working-directory: ./infra/code-review-gpt
run: npm install code-review-gpt
- name: List Modified Files (Debugging Step)
run: |
git fetch origin ${{ github.base_ref }}
git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
- name: Run Code Review GPT
working-directory: ./infra/code-review-gpt
run: npx code-review-gpt review --ci=github --model=$MODEL --base-sha=$BASE_SHA --head-sha=$HEAD_SHA
env:
MODEL: gpt-3.5-turbo
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}