diff --git a/.github/workflows/code_review.yml b/.github/workflows/code_review.yml index d38be41..a15948b 100644 --- a/.github/workflows/code_review.yml +++ b/.github/workflows/code_review.yml @@ -32,6 +32,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + # Optional: update to a model of your choice from https://platform.openai.com/docs/models + OPENAI_MODEL: "gpt-4o" - name: Comment on Pull Request run: | diff --git a/README.md b/README.md index 446ea42..c5c2a4a 100644 --- a/README.md +++ b/README.md @@ -8,15 +8,21 @@ 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. +Installation is as simple as adding your Open API key, and adding 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 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) +Open API Api Key + +Add secrets Note that GITHUB_TOKEN does not need to be added as it is available by default. -2. Add the following file to a new folder in your repo .github/workflows/code_review.yml +2. Create a new folder and file in your repo **.github/workflows/code_review.yml** + +Copy the file from here: [cody_review.yml](https://github.com/your-repo/.github/workflows/cody_review.yml) + +Or available below: ``` name: Automated Code Review by Cody @@ -53,6 +59,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + # Optional: update to a model of your choice from https://platform.openai.com/docs/models + OPENAI_MODEL: "gpt-4o" - name: Comment on Pull Request run: | @@ -67,25 +75,28 @@ permissions: 3. Commit your code, create a pull request and watch Cody in action! -![PR Code Review Image](pr_code_review.png) +PR Code Review Image + +PR Code Review Image ## Development Clone the repo. -Note venv (virtual environment) is used so ensure that versions etc are specific to this repo. +Note venv (virtual environment) is used to ensure that versions etc are specific to this repo. `python -m venv venv` and `pip install -r requirements.txt` -To activiate +To activiate: `source venv/bin/activate` -To deactivate, `deactivate` +To deactivate: +`deactivate` ### Testing -Create an .env +Create an .env: ``` OPENAI_API_KEY=token_here @@ -93,12 +104,18 @@ GITHUB_TOKEN=token_here GITLAB_TOKEN=your_gitlab_token_here ``` -And then run +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. + +## Contributing + +Contributions are welcome! Whether it's submitting issues, suggesting improvements, or contributing code, we appreciate your input. + +Please note that while this project is currently open for contributions, it is not open source. There may be an enterprise plan available in the future that will include additional features and support. + +Feel free to reach out via [david@codylabs.io](mailto:david@codylabs.io) if you have any questions or ideas. diff --git a/add_a_secret_image.png b/add_a_secret_image.png deleted file mode 100644 index 1a441eb..0000000 Binary files a/add_a_secret_image.png and /dev/null differ diff --git a/cody_review_1.png b/cody_review_1.png new file mode 100644 index 0000000..8b09ac4 Binary files /dev/null and b/cody_review_1.png differ diff --git a/cody_review_2.png b/cody_review_2.png new file mode 100644 index 0000000..950a17d Binary files /dev/null and b/cody_review_2.png differ diff --git a/image.png b/image.png deleted file mode 100644 index bf0dbe5..0000000 Binary files a/image.png and /dev/null differ diff --git a/openai.png b/openai.png new file mode 100644 index 0000000..99ec4b2 Binary files /dev/null and b/openai.png differ diff --git a/repo_secrets.png b/repo_secrets.png new file mode 100644 index 0000000..57ea3a0 Binary files /dev/null and b/repo_secrets.png differ