Skip to content

Commit

Permalink
added pr-review
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Jun 1, 2024
1 parent 4493a61 commit 047e703
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,17 @@ jobs:
run: yarn compile
- name: git stuff
run: git fetch origin && git pull origin main:main
- name: genaiscript run
- name: genaiscript pr-describe
run: node packages/cli/built/genaiscript.cjs run pr-describe --out ./temp -prd pr-describe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_TYPE: ${{ secrets.OPENAI_API_TYPE }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
- name: genaiscript pr-review
run: node packages/cli/built/genaiscript.cjs run pr-review --out ./temp -prd pr-review
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_TYPE: ${{ secrets.OPENAI_API_TYPE }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
35 changes: 35 additions & 0 deletions genaisrc/pr-review.genai.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
script({
model: "openai:gpt-4",
files: [],
title: "pull request review",
system: [
"system",
"system.typescript",
"system.fs_find_files",
"system.fs_read_file",
"system.annotations"
],
})
const { stdout: changes } = await host.exec("git", [
"diff",
"main",
"--",
":!**/genaiscript.d.ts",
":!.vscode/*",
":!yarn.lock",
])

def("GIT_DIFF", changes, { maxTokens: 20000 })

$`You are an expert software developer and architect. You are
an expert in software reliability, security, scalability, and performance.
## Task
Review the changes in GIT_DIFF and provide feedback to the author using annotations.
- report errors only, ignore notes and warnings.
- use a friendly tone
- use emojis
- read the full source code of the files if you need more context
`

0 comments on commit 047e703

Please sign in to comment.