diff --git a/.github/workflows/code_review.yml/code_review.yml b/.github/workflows/code_review.yml similarity index 93% rename from .github/workflows/code_review.yml/code_review.yml rename to .github/workflows/code_review.yml index 412a997..d38be41 100644 --- a/.github/workflows/code_review.yml/code_review.yml +++ b/.github/workflows/code_review.yml @@ -11,28 +11,28 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Clone cody-code-reviewer repository + - name: Clone cody-code-reviewer repository run: | git clone https://github.com/codylabs/cody-code-reviewer.git cd cody-code-reviewer - + - name: Set up Python 3.9 uses: actions/setup-python@v4 with: python-version: "3.9" - + - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt - + - name: Run Code Review Model run: | python src/review_pull_request.py ${{ github.event.pull_request.number }} ${{ github.repository }} > ${{ github.workspace }}/output.txt env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - + - name: Comment on Pull Request run: | python src/comment_on_pr.py ${{ github.event.pull_request.number }} "${{ secrets.GITHUB_TOKEN }}" ${{ github.repository }} diff --git a/README.md b/README.md index 363ce83..446ea42 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,22 @@ ## About -With no coding required to set up, Cody will automatically summarize and code review your changes on every pull request or merge request using AI. +Cody will automatically summarize and code review your changes on every pull request using Open AI models. + +Note that an Open API key is required. Read more at [https://codylabs.io/](https://codylabs.io/) ## Installation -Installation is as simple as adding your open API key, and creating a Github Actions workflow file to your repo. - -If you prefer you can watch these steps on YouTube: +Installation is as simple as adding your Open API key, and creating a Github Actions workflow file to your repo. -1. Add OPENAI_API_KEY as a github repo secret via Settings > Actions > Secrets and variables > New reposity secret. The variable name should be OPENAI_API_KEY and the value should be your Open API API Key. +1. Add OPENAI_API_KEY as a GitHub repo secret via Settings > Actions > Secrets and variables > New repository secret. The variable name should be OPENAI_API_KEY, and the value should be your Open API API Key. ![Add secrets](add_a_secret_image.png) -Note that GITHUB_TOKEN does not need to be added as is available by default. +Note that GITHUB_TOKEN does not need to be added as it is available by default. -2. Add the following to a new folder in your repo .github/workflows/code_review.yml +2. Add the following file to a new folder in your repo .github/workflows/code_review.yml ``` name: Automated Code Review by Cody @@ -32,7 +32,7 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Clone cody-code-reviewer repository + - name: Clone cody-code-reviewer repository run: | git clone https://github.com/codylabs/cody-code-reviewer.git cd cody-code-reviewer @@ -65,7 +65,7 @@ permissions: pull-requests: write ``` -3. Commit your code and watch Cody in action! +3. Commit your code, create a pull request and watch Cody in action! ![PR Code Review Image](pr_code_review.png) @@ -98,3 +98,7 @@ And then run `PYTHONPATH=src pytest -s tests/` This will run the code review logic on an GitHub Pull Request and log the output. + +## License + +See the LICENSE.md file for details. diff --git a/pr_code_review.png b/image.png similarity index 100% rename from pr_code_review.png rename to image.png