From 22776a95700ba035ef2d5c02ebedc4ae30b435f7 Mon Sep 17 00:00:00 2001 From: Bhavik MacBook PRO 16 Date: Fri, 12 May 2023 00:09:19 +0530 Subject: [PATCH] Added more descriptive summary for OpenAI --- action.yaml | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/action.yaml b/action.yaml index 442c080..e6b07c5 100644 --- a/action.yaml +++ b/action.yaml @@ -27,17 +27,50 @@ inputs: default: 'github' PROMPT_TEMPLATE: description: 'The template for the FULL_REVIEW_COMMENT prompt.' - default: 'Please analyze the pull request''s code and inform me whether it requires optimization, and provide an explanation for your decision: + default: 'Your task is to act as a code reviewer and review a pull request by summarizing the changes made, identifying potential issues related to logic and runtime, and creating a bullet list of action items needed before the change can be approved. The output should focus on items mentioned in the given code review checklist. + Instructions: + - Review the output of git diff for the pull request + - Summarize the overview of the changes made + - Identify potential issues related to logic and runtime + - Output as a markdown document, with the following sections: + {output} + - If there are no issues, output "None" + - If there are no action items, output "None" + - Create a bullet list of action items needed before the change can be approved + - The response sentences are no longer than 16 words each + - Keep the response sentences as short as possible + - Focus on items mentioned in the given code review checklist: + {checklist} + \`\`\` ${code} \`\`\`' + output: ' + #### Overview of changes: + - Summarize the overview of the changes made + #### issues: + - Identify potential issues related to logic and runtime + - Identify issues mentioned in the code review checklist + #### Action items: + - Action items needed before the change can be approved' + checklist: ' + Code Structure + - Is the codebase organized according to Laravel Framework recommended project structure? + - Are there any unnecessary files, folders, or code modules? + - Does the code follow the Single Responsibility Principle (SRP) and Dont Repeat Yourself (DRY) principle? + Error Handling + - Are all error scenarios covered in the code? + - Are the error messages clear and helpful? + - Is the code handling errors gracefully? + Security + - Are sensitive data and credentials stored securely? + - Are all external libraries and packages up-to-date? + - Is the code protected against common security vulnerabilities such as SQL injection and cross-site scripting (XSS)?' ANSWER_TEMPLATE: description: 'The template for the answer sent to the GitHub comment.' default: 'AI Code Review: - ${answer}' - runs: using: 'node16' main: 'dist/index.js'