From 95919ea744a388341a07a9bb8a91238d081cba10 Mon Sep 17 00:00:00 2001 From: Tushar Nikam Date: Mon, 16 Sep 2024 18:28:29 +0530 Subject: [PATCH] Update run_code_reviewer.sh --- scripts/run_code_reviewer.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/run_code_reviewer.sh b/scripts/run_code_reviewer.sh index b1a4716..e51fec5 100755 --- a/scripts/run_code_reviewer.sh +++ b/scripts/run_code_reviewer.sh @@ -3,7 +3,7 @@ # Exit on any error set -e -# Set environment variables +# Environment variables OPENAI_API_KEY="$OPENAI_API_KEY" GITHUB_TOKEN="$GITHUB_TOKEN" GITHUB_REPO="$GITHUB_REPO" @@ -40,7 +40,7 @@ git fetch --all git checkout main # Get the list of changed files in the PR -CHANGED_FILES=$(git diff --name-only origin/main) +CHANGED_FILES=$(git diff --name-only origin/main...HEAD) echo "Changed files:" echo "$CHANGED_FILES" @@ -51,7 +51,7 @@ success=true for file in $CHANGED_FILES; do echo "Reviewing $file" - FILE_DIFF=$(git diff origin/main -- "$file") + FILE_DIFF=$(git diff origin/main...HEAD -- "$file") RESPONSE=$(curl -X POST https://api.openai.com/v1/completions \ -H "Authorization: Bearer $OPENAI_API_KEY" \