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

chore: readme #3

Merged
merged 3 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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.
File renamed without changes
Loading