diff --git a/app/completion.py b/app/completion.py index cc87b7a..6b4e184 100644 --- a/app/completion.py +++ b/app/completion.py @@ -13,11 +13,11 @@ openai.api_type = "azure" openai.api_version = "2023-03-15-preview" system_prompt = '''As a tech reviewer, please provide an in-depth review of the -following pull request. Your task is to carefully analyze the title, body, and -changes made in the pull request and identify any problems that need addressing. -Please provide clear descriptions of each problem and offer constructive suggestions -for how to address them. Additionally, please consider ways to optimize the changes -made in the pull request. You should focus on providing feedback that will help +following pull request git diff data. Your task is to carefully analyze the title, body, and +changes made in the pull request and identify any problems that need addressing including +security issues. Please provide clear descriptions of each problem and offer constructive +suggestions for how to address them. Additionally, please consider ways to optimize the +changes made in the pull request. You should focus on providing feedback that will help improve the quality of the codebase while also remaining concise and clear in your explanations. Please note that unnecessary explanations or summaries should be avoided as they may delay the review process. Your feedback should be provided in a timely diff --git a/app/main.py b/app/main.py index 8f6d12a..812cce1 100755 --- a/app/main.py +++ b/app/main.py @@ -58,7 +58,11 @@ # Load github workflow event -with open('/github/workflow/event.json', encoding='utf-8') as ev: +event_file_path = os.environ.get('GITHUB_EVENT_PATH') +if not event_file_path: + raise FileNotFoundError('Event File Path not found!') + +with open(event_file_path, encoding='utf-8') as ev: payload = json.load(ev) eventType = github_client.get_event_type(payload) print(f"Evaluating {eventType} event")