Skip to content

Commit e2b0a66

Browse files
author
Marco Damonte
committed
fix task fields
1 parent 19e6799 commit e2b0a66

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/github/junie/junie-tasks.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ export async function prepareJunieTask(
5858
junieCLITask.mergeTask = {branch: branchInfo.prBaseBranch || branchInfo.baseBranch}
5959
} else if (isCodeReviewEvent(context)) {
6060
const diffPoint = context.isPR ? String(context.entityNumber) : branchInfo.prBaseBranch || branchInfo.baseBranch;
61-
junieCLITask.codeReviewTask = {diffPoint}
61+
const diffCommand = `gh pr diff ${diffPoint}`;
62+
junieCLITask.codeReview = {diffCommand}
6263
} else {
6364
const formatter = new NewGitHubPromptFormatter();
6465
let fetchedData: FetchedData = {};
@@ -89,7 +90,7 @@ export async function prepareJunieTask(
8990
junieCLITask.task = await getValidatedTextTask(promptText);
9091
}
9192

92-
if (!junieCLITask.task && !junieCLITask.mergeTask && !junieCLITask.codeReviewTask) {
93+
if (!junieCLITask.task && !junieCLITask.mergeTask && !junieCLITask.codeReview) {
9394
throw new Error("No task was created. Please check your inputs.");
9495
}
9596

src/github/junie/types/junie.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ export interface MergeTask {
1313
branch: string;
1414
}
1515

16-
export interface CodeReviewTask {
17-
diffPoint: string;
16+
export interface CodeReview {
17+
description?: string;
18+
diffCommand?: string;
1819
}
1920

2021
export interface CliInput {
2122
task?: string;
2223
mergeTask?: MergeTask;
23-
codeReviewTask?: CodeReviewTask;
24+
codeReview?: CodeReview;
2425
}

0 commit comments

Comments
 (0)