Skip to content
Merged
Show file tree
Hide file tree
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
26 changes: 0 additions & 26 deletions .github/workflows/ai-codereviewer.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/ai-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: AI Code Reviewer

permissions:
contents: read
pull-requests: write

on:
pull_request:
pull_request_review_comment:
types: [created]

concurrency:
group:
${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }}-${{ github.event_name == 'pull_request_review_comment' && 'pr_comment' || 'pr' }}
cancel-in-progress: ${{ github.event_name != 'pull_request_review_comment' }}
Comment thread
harderthan marked this conversation as resolved.

jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: coderabbitai/ai-pr-reviewer@latest
env:
Comment thread
harderthan marked this conversation as resolved.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
with:
debug: false
Comment thread
harderthan marked this conversation as resolved.
review_simple_changes: false
Comment thread
harderthan marked this conversation as resolved.
review_comment_lgtm: true
Comment on lines +1 to +28
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The new workflow file ai-review.yml looks good overall. It has clearly defined permissions, triggers, concurrency settings, and job steps. However, there is a potential security concern with the exposure of sensitive environment variables like GITHUB_TOKEN and OPENAI_API_KEY. Although these are stored as secrets, it's best practice to limit their scope of usage.

-           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-           OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
+           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+           OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

Please ensure that the coderabbitai/ai-pr-reviewer@latest action is from a trusted source and maintained regularly to prevent any potential security vulnerabilities. Also, consider pinning the action to a specific version instead of using @latest to avoid unexpected changes in behavior due to updates.

-       - uses: coderabbitai/ai-pr-reviewer@latest
+       - uses: coderabbitai/ai-pr-reviewer@v1.0.0

Lastly, please make sure that the repository has the necessary secrets (GITHUB_TOKEN and OPENAI_API_KEY) set up correctly for this workflow to function as expected.

Loading