From 26f5881f43c81f0872c29fce0cf88fa99bd4fe1e Mon Sep 17 00:00:00 2001 From: Will Hohyon Ryu Date: Thu, 7 Mar 2024 19:41:59 -0800 Subject: [PATCH 1/3] chore: remove unnecessary error handling in main function --- src/main.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index 2912379..63ab5df 100644 --- a/src/main.ts +++ b/src/main.ts @@ -69,7 +69,4 @@ async function main() { } } -main().catch((error) => { - console.error("Error:", error); - process.exit(1); -}); +main(); From a242c742a4fa9463c9528bcbc86b9a5e988da728 Mon Sep 17 00:00:00 2001 From: Will Hohyon Ryu Date: Thu, 7 Mar 2024 19:47:10 -0800 Subject: [PATCH 2/3] feat(createPrompt): add console log for language variable --- src/createPrompt.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/createPrompt.ts b/src/createPrompt.ts index ae345a0..fa2d914 100644 --- a/src/createPrompt.ts +++ b/src/createPrompt.ts @@ -12,6 +12,8 @@ export interface PRDetails { const language: string = core.getInput("language") || 'English'; export function createPrompt(file: File, chunk: Chunk, prDetails: PRDetails): string { + console.log('language', language); + return `Your task is to review pull requests. Instructions: - Provide the response in following JSON format: {"reviews": [{"lineNumber": , "reviewComment": ""}]} - Do not give positive comments or compliments. From 9defc56369b19a4c8f3dd6a989d7c204a26dae4f Mon Sep 17 00:00:00 2001 From: Will Hohyon Ryu Date: Thu, 7 Mar 2024 19:51:23 -0800 Subject: [PATCH 3/3] chore: Update node version in action.yml and language instructions in createPrompt.ts --- action.yml | 2 +- src/createPrompt.ts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index b4619d9..4a5db05 100644 --- a/action.yml +++ b/action.yml @@ -20,7 +20,7 @@ inputs: required: false default: "" runs: - using: "node16" + using: "node20" main: "dist/index.js" branding: icon: "aperture" diff --git a/src/createPrompt.ts b/src/createPrompt.ts index fa2d914..0971668 100644 --- a/src/createPrompt.ts +++ b/src/createPrompt.ts @@ -12,12 +12,10 @@ export interface PRDetails { const language: string = core.getInput("language") || 'English'; export function createPrompt(file: File, chunk: Chunk, prDetails: PRDetails): string { - console.log('language', language); - return `Your task is to review pull requests. Instructions: - Provide the response in following JSON format: {"reviews": [{"lineNumber": , "reviewComment": ""}]} - Do not give positive comments or compliments. -- Provide review in ${language} language. +- Provide comments in ${language} language. - Provide comments and suggestions ONLY if there is something to improve, otherwise "reviews" should be an empty array. - Write the comment in GitHub Markdown format. - Use the given description only for the overall context and only comment the code.