mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-04-19 17:16:48 +00:00
Add support for pullrequest->labeled event
This commit is contained in:
parent
a9a064dfa1
commit
38e320dd5a
3 changed files with 1310 additions and 1308 deletions
3
dist/index.js
vendored
3
dist/index.js
vendored
|
@ -192,7 +192,8 @@ function main() {
|
|||
const prDetails = yield getPRDetails();
|
||||
let diff;
|
||||
const eventData = JSON.parse((0, fs_1.readFileSync)((_a = process.env.GITHUB_EVENT_PATH) !== null && _a !== void 0 ? _a : "", "utf8"));
|
||||
if (eventData.action === "opened") {
|
||||
let actionNames = ["opened", "labeled", "reopened"];
|
||||
if (actionNames.includes(eventData.action)) {
|
||||
diff = yield getDiff(prDetails.owner, prDetails.repo, prDetails.pull_number);
|
||||
}
|
||||
else if (eventData.action === "synchronize") {
|
||||
|
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -87,8 +87,7 @@ function createPrompt(file: File, chunk: Chunk, prDetails: PRDetails): string {
|
|||
- Use the given description only for the overall context and only comment the code.
|
||||
- IMPORTANT: NEVER suggest adding comments to the code.
|
||||
|
||||
Review the following code diff in the file "${
|
||||
file.to
|
||||
Review the following code diff in the file "${file.to
|
||||
}" and take the pull request title and description into account when writing the response.
|
||||
|
||||
Pull request title: ${prDetails.title}
|
||||
|
@ -188,7 +187,9 @@ async function main() {
|
|||
readFileSync(process.env.GITHUB_EVENT_PATH ?? "", "utf8")
|
||||
);
|
||||
|
||||
if (eventData.action === "opened") {
|
||||
let actionNames: string[] = ["opened", "labeled", "reopened"]
|
||||
|
||||
if (actionNames.includes(eventData.action)) {
|
||||
diff = await getDiff(
|
||||
prDetails.owner,
|
||||
prDetails.repo,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue