Skip to content

Commit

Permalink
fix: ignore patterns and add include patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
anc95 committed Nov 22, 2024
1 parent 12a11df commit 1d0b56f
Show file tree
Hide file tree
Showing 8 changed files with 2,262 additions and 281 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ max_tokens=
TARGET_LABEL=
MAX_PATCH_LENGTH=
PROMPT=Below there is a code diff please help me do a code review
IGNORE_PATTERNS=/node_modules,*.md # Regex pattern to ignore files, separated by comma
IGNORE_PATTERNS=/node_modules,*.md # glob pattern or regex pattern to ignore files, separated by comma
INCLUDE_PATTERNS=*.js,*.ts # glob pattern or regex pattern to include files, separated by comma
21 changes: 21 additions & 0 deletions .github/workflows/cr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Code Review

permissions:
contents: read
pull-requests: write

on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: anc95/ChatGPT-CodeReview@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
LANGUAGE: Chinese
OPENAI_API_ENDPOINT: https://api.bianxie.ai/v1
LOG_LEVEL: debug
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ jobs:
temperature: 1 # https://platform.openai.com/docs/api-reference/chat/create#chat/create-temperature
max_tokens: 10000
MAX_PATCH_LENGTH: 10000 # if the patch/diff length is large than MAX_PATCH_LENGTH, will be ignored and won't review. By default, with no MAX_PATCH_LENGTH set, there is also no limit for the patch/diff length.
IGNORE_PATTERNS: /node_modules,*.md # Regex pattern to ignore files, separated by comma
IGNORE_PATTERNS=/node_modules,*.md # glob pattern or regex pattern to ignore files, separated by comma
INCLUDE_PATTERNS=*.js,*.ts # glob pattern or regex pattern to include files, separated by comma

# IF you are using azure openai
AZURE_API_VERSION: xx
Expand Down
Loading

0 comments on commit 1d0b56f

Please sign in to comment.