Update review.yml

This commit is contained in:
PierreGode 2024-12-10 14:13:49 +01:00 committed by GitHub
parent 8278a42b2e
commit e2032438c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,7 +23,7 @@ jobs:
- name: Run AI Analysis - name: Run AI Analysis
env: env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GITHUB_TOKEN: ${{ secrets.G_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
python - <<EOF python - <<EOF
import os import os
@ -56,8 +56,8 @@ jobs:
diff_url = event['pull_request']['url'] + "/files" diff_url = event['pull_request']['url'] + "/files"
pr_files = requests.get(diff_url, headers=headers).json() pr_files = requests.get(diff_url, headers=headers).json()
diff_text = ""
inline_comments = [] # Collect inline comments to post inline_comments = [] # Collect inline comments to post
diff_text = ""
for fdata in pr_files: for fdata in pr_files:
filename = fdata['filename'] filename = fdata['filename']
@ -107,7 +107,7 @@ jobs:
headers={'Authorization': f'token {token}', 'Accept': 'application/vnd.github.v3+json'}, headers={'Authorization': f'token {token}', 'Accept': 'application/vnd.github.v3+json'},
json=review_data) json=review_data)
review_response.raise_for_status() review_response.raise_for_status()
print("Review comments posted successfully.") print("Inline review comments posted successfully.")
else: else:
print("No critical issues found in the code.") print("No critical issues found in the code.")