ai-code-review.yaml added #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: AI Code Reviewer | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
jobs: | |
ai-code-review: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Check out the pull request code | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# Step 2: Set up environment variables | |
- name: Set up environment variables | |
run: | | |
echo "Setting up environment variables..." | |
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> $GITHUB_ENV | |
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
echo "GITHUB_REPO=${{ github.repository }}" >> $GITHUB_ENV | |
echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV | |
# Step 3: Install jq for JSON parsing | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y jq | |
# Step 4: Run the AI code reviewer | |
- name: Run AI Code Reviewer | |
run: ./scripts/run_code_reviewer.sh |