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

Added ai-pr-reviewer.yaml workflow #7158

Closed
wants to merge 2 commits into from
Closed
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
30 changes: 30 additions & 0 deletions .github/workflows/ai-pr-reviewer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
with:
debug: false
review_simple_changes: false
review_comment_lgtm: false
Comment on lines +24 to +30
Copy link

@coderabbitai coderabbitai bot Nov 14, 2024

Choose a reason for hiding this comment

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

💡 Codebase verification

Action Required: Configure OPENAI_API_KEY Secret

The verification confirms that the required OPENAI_API_KEY secret is not configured in the repository settings. This secret is essential for the AI PR reviewer workflow to function properly.

Please:

  • Go to your repository's Settings > Secrets and Variables > Actions
  • Click on "New repository secret"
  • Add a secret named OPENAI_API_KEY with your OpenAI API key as the value
🔗 Analysis chain

Verify required secrets are configured.

The workflow requires OPENAI_API_KEY secret for operation. Please ensure this secret is configured in your repository settings.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if required secrets are configured in the repository

# Check for OPENAI_API_KEY secret
gh api /repos/$GITHUB_REPOSITORY/actions/secrets/OPENAI_API_KEY &>/dev/null
if [ $? -eq 0 ]; then
    echo "✓ OPENAI_API_KEY secret is configured"
else
    echo "⨯ OPENAI_API_KEY secret is missing"
fi

Length of output: 144

Copy link
Member Author

Choose a reason for hiding this comment

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

Why do I ever need this workflow file and open api key? Currently, you do the review without this things configured

Copy link

Choose a reason for hiding this comment

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

@arkadius, the ai-pr-reviewer.yml workflow file allows you to integrate CodeRabbit's AI-powered code reviews directly into your GitHub repository. By adding this workflow and configuring the OPENAI_API_KEY secret, you enable automated code reviews for your pull requests as part of your CI/CD pipeline. Currently, reviews are performed externally, but with this setup, the process becomes integrated and streamlined within your repository.

(•ᴥ•) Thinking rabbit wonders if this clarifies things!

Loading