-
Notifications
You must be signed in to change notification settings - Fork 34
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
Create ai-pr-reviewer.yml #92
Conversation
Uplevel your code reviews with CodeRabbit ProCodeRabbit ProIf you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Files selected (1)
- .github/workflows/ai-pr-reviewer.yml (1)
Files not summarized due to errors (1)
- .github/workflows/ai-pr-reviewer.yml (nothing obtained from openai)
Files not reviewed due to errors (1)
- .github/workflows/ai-pr-reviewer.yml (no response)
Review comments generated (0)
- Review: 0
- LGTM: 0
Tips
Chat with CodeRabbit Bot (@coderabbitai
)
- Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
- Invite the bot into a review comment chain by tagging
@coderabbitai
in a reply.
Code suggestions
- The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
- You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.
Pausing incremental reviews
- Add
@coderabbitai: ignore
anywhere in the PR description to pause further reviews from the bot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Files selected (1)
- .github/workflows/ai-pr-reviewer.yml (1)
Files not summarized due to errors (1)
- .github/workflows/ai-pr-reviewer.yml (nothing obtained from openai)
Review comments generated (1)
- Review: 1
- LGTM: 0
Tips
Chat with CodeRabbit Bot (@coderabbitai
)
- Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
- Invite the bot into a review comment chain by tagging
@coderabbitai
in a reply.
Code suggestions
- The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
- You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.
Pausing incremental reviews
- Add
@coderabbitai: ignore
anywhere in the PR description to pause further reviews from the bot.
name: Code Review | ||
|
||
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' }} | ||
|
||
jobs: | ||
review: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: coderabbitai/ai-pr-reviewer@latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.AI_PR_GITHUB_TOKEN }} | ||
OPENAI_API_KEY: ${{ secrets.AI_PR_OPENAI_API_KEY }} | ||
with: | ||
debug: false | ||
review_simple_changes: false | ||
review_comment_lgtm: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow file seems to be well structured and follows the standard GitHub Actions format. However, there are a few points that need attention:
-
The
permissions
section is set to read contents and write pull requests. This is good for security as it limits the scope of what this action can do. -
The
concurrency
section is used to ensure that only one instance of this workflow runs at a time per pull request. This is a good practice to prevent race conditions. -
The
jobs
section specifies that this workflow will run on the latest version of Ubuntu and uses thecoderabbitai/ai-pr-reviewer@latest
. It's generally recommended to pin actions to a specific commit or version for stability and security reasons. Usinglatest
could potentially introduce breaking changes or vulnerabilities if the action is updated. -
The environment variables
GITHUB_TOKEN
andOPENAI_API_KEY
are fetched from secrets which is a secure way to handle sensitive data. -
In the
with
section,debug
,review_simple_changes
, andreview_comment_lgtm
are all set to false. Depending on your needs, you might want to enable some of these options. For example, settingreview_simple_changes
to true would make the bot review even simple changes, which could be useful for catching small mistakes.
Here's a suggested change to pin the action to a specific version:
- - uses: coderabbitai/ai-pr-reviewer@latest
+ - uses: coderabbitai/ai-pr-reviewer@v1.0.0
Use Pro version |
Description
CodeRabbit ai-pr-reviewer is an AI-based code reviewer and summarizer for GitHub pull requests using OpenAI's gpt-3.5-turbo and gpt-4 models. It is designed to be used as a GitHub Action and can be configured to run on every pull request and review comments
Checklist