Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update review.yml #100

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ jobs:

# Call OpenAI for inline code analysis
issues_prompt = f"""
Review the following code patch for errors and issues such as:
You are a code reviewer. Analyze the following code patch for issues such as:
- Syntax errors
- Logical errors
- Typos or misconfigurations
- Best practices
Provide specific inline comments that include:
- The exact line number
- A clear explanation of the issue
- A suggested fix (if possible)
Only analyze the code in this patch:
- A suggested fix
Analyze only the provided code:
{patch}
"""
ai_headers = {"Content-Type": "application/json", "Authorization": f"Bearer {openai_key}"}
Expand All @@ -90,6 +90,9 @@ jobs:
issues_response.raise_for_status()
issues = issues_response.json()['choices'][0]['message']['content'].strip()

# Debug: Log the AI's response
print(f"AI Response:\n{issues}")

# Parse issues for inline comments
if issues and "no issues found" not in issues.lower():
for issue in issues.split("\\n- "):
Expand Down
Loading