mirror of
https://github.com/PierreGode/Linux-Active-Directory-join-script.git
synced 2025-12-21 08:50:12 +01:00
Merge pull request #100 from PierreGode/PierreGode-patch-5
Update review.yml
This commit is contained in:
commit
7a6ee82a1a
11
.github/workflows/review.yml
vendored
11
.github/workflows/review.yml
vendored
@ -69,15 +69,15 @@ jobs:
|
|||||||
|
|
||||||
# Call OpenAI for inline code analysis
|
# Call OpenAI for inline code analysis
|
||||||
issues_prompt = f"""
|
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
|
- Syntax errors
|
||||||
- Logical errors
|
- Logical errors
|
||||||
- Typos or misconfigurations
|
- Best practices
|
||||||
Provide specific inline comments that include:
|
Provide specific inline comments that include:
|
||||||
- The exact line number
|
- The exact line number
|
||||||
- A clear explanation of the issue
|
- A clear explanation of the issue
|
||||||
- A suggested fix (if possible)
|
- A suggested fix
|
||||||
Only analyze the code in this patch:
|
Analyze only the provided code:
|
||||||
{patch}
|
{patch}
|
||||||
"""
|
"""
|
||||||
ai_headers = {"Content-Type": "application/json", "Authorization": f"Bearer {openai_key}"}
|
ai_headers = {"Content-Type": "application/json", "Authorization": f"Bearer {openai_key}"}
|
||||||
@ -90,6 +90,9 @@ jobs:
|
|||||||
issues_response.raise_for_status()
|
issues_response.raise_for_status()
|
||||||
issues = issues_response.json()['choices'][0]['message']['content'].strip()
|
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
|
# Parse issues for inline comments
|
||||||
if issues and "no issues found" not in issues.lower():
|
if issues and "no issues found" not in issues.lower():
|
||||||
for issue in issues.split("\\n- "):
|
for issue in issues.split("\\n- "):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user