Skip to content

Commit 820ecd7

Browse files
authoredNov 22, 2024
fix: ignore patterns and add include patterns (#168)
1 parent 355a405 commit 820ecd7

File tree

8 files changed

+2262
-281
lines changed

8 files changed

+2262
-281
lines changed
 

‎.env.example

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ max_tokens=
2121
TARGET_LABEL=
2222
MAX_PATCH_LENGTH=
2323
PROMPT=Below there is a code diff please help me do a code review
24-
IGNORE_PATTERNS=/node_modules,*.md # Regex pattern to ignore files, separated by comma
24+
IGNORE_PATTERNS=/node_modules,*.md # glob pattern or regex pattern to ignore files, separated by comma
25+
INCLUDE_PATTERNS=*.js,*.ts # glob pattern or regex pattern to include files, separated by comma

‎.github/workflows/cr.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Code Review
2+
3+
permissions:
4+
contents: read
5+
pull-requests: write
6+
7+
on:
8+
pull_request:
9+
types: [opened, reopened, synchronize]
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: anc95/ChatGPT-CodeReview@main
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
19+
LANGUAGE: Chinese
20+
OPENAI_API_ENDPOINT: https://api.bianxie.ai/v1
21+
LOG_LEVEL: debug

‎README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ jobs:
6767
temperature: 1 # https://platform.openai.com/docs/api-reference/chat/create#chat/create-temperature
6868
max_tokens: 10000
6969
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.
70-
IGNORE_PATTERNS: /node_modules,*.md # Regex pattern to ignore files, separated by comma
70+
IGNORE_PATTERNS=/node_modules,*.md # glob pattern or regex pattern to ignore files, separated by comma
71+
INCLUDE_PATTERNS=*.js,*.ts # glob pattern or regex pattern to include files, separated by comma
7172

7273
# IF you are using azure openai
7374
AZURE_API_VERSION: xx

0 commit comments

Comments
 (0)
Failed to load comments.