feat(openai): finish integration (#2)

This commit is contained in:
Felix Anhalt 2024-10-08 10:09:47 +02:00 committed by GitHub
parent 2bc0b14bb0
commit cdae45ec23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 20 deletions

View file

@ -22,8 +22,7 @@ review process.
3. Create a `.github/workflows/main.yml` file in your repository and add the following content: 3. Create a `.github/workflows/main.yml` file in your repository and add the following content:
```yaml ```yaml
name: AI Code Reviewer name: Code Review with OpenAI
on: on:
pull_request: pull_request:
types: types:
@ -31,19 +30,21 @@ on:
- synchronize - synchronize
permissions: write-all permissions: write-all
jobs: jobs:
review: code_review:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Repo - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Code Review
- name: AI Code Reviewer uses: oev-berlin/ai-codereviewer@main
uses: your-username/ai-code-reviewer@main
with: with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # The GITHUB_TOKEN is there by default so you just need to keep it like it is and not necessarily need to add it as secret as it will throw an error. [More Details](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret) GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_MODEL: "gpt-4" # Optional: defaults to "gpt-4" OPENAI_API_MODEL: "gpt-4o"
exclude: "**/*.json, **/*.md" # Optional: exclude patterns separated by commas OPENAI_API_BASE_URL: ${{ secrets.OPENAI_API_BASE_URL }}
OPENAI_API_DEPLOYMENT: ${{ secrets.OPENAI_API_DEPLOYMENT }}
OPENAI_API_VERSION: ${{ secrets.OPENAI_API_VERSION }}
exclude: "yarn.lock,dist/**"
``` ```
4. Replace `your-username` with your GitHub username or organization name where the AI Code Reviewer repository is 4. Replace `your-username` with your GitHub username or organization name where the AI Code Reviewer repository is

View file

@ -12,7 +12,7 @@ inputs:
required: false required: false
default: "gpt-4" default: "gpt-4"
OPENAI_API_BASE_URL: OPENAI_API_BASE_URL:
description: "OpenAI API Base Url like https://my-openai.openai.azure.com/." description: "OpenAI API Base Url like https://my-openai.openai.azure.com/openai/."
required: true required: true
default: "" default: ""
OPENAI_API_DEPLOYMENT: OPENAI_API_DEPLOYMENT: