Skip to content

Commit

Permalink
Merge pull request #10 from dmdhrumilmistry/main
Browse files Browse the repository at this point in the history
load github event path dynamically from env
  • Loading branch information
feiskyer authored Nov 3, 2023
2 parents bbbac3b + 7c464d8 commit ab02ca4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 5 additions & 5 deletions app/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit ab02ca4

Please sign in to comment.