https://github.com/amondnet/bard-codereview
A code review bot powered by Bard
https://github.com/amondnet/bard-codereview
bard codereview
Last synced: 7 months ago
JSON representation
A code review bot powered by Bard
- Host: GitHub
- URL: https://github.com/amondnet/bard-codereview
- Owner: amondnet
- License: isc
- Created: 2023-05-18T09:42:13.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-18T11:25:44.000Z (almost 3 years ago)
- Last Synced: 2025-03-04T08:28:24.047Z (about 1 year ago)
- Topics: bard, codereview
- Language: JavaScript
- Homepage:
- Size: 6.98 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.ja.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# CodeReview BOT
> A code review robot powered by Bard
Translation Versions: [ENGLISH](./README.md) | [中文简体](./README.zh-CN.md) | [中文繁體](./README.zh-TW.md) | [한국어](./README.ko.md) | [日本語](./README.ja.md)
## Usage
❗️⚠️ コストを考慮してBOTはテスト目的でのみ使用され、現在AWS Lambdaに展開されて速度制限を受けています。そのため、不安定な状況は完全に正常です。アプリケーションを直接展開することをお勧めします。
## Install
Install: [apps/cr-gpt](https://github.com/apps/cr-gpt);
### Configuration
1. リポジトリのホームページに移動します
2. `settings` をクリックします
3. `secrets and variables` メニューの下の `actions` をクリックします
4. `New repository variable` をクリックしてOpenAI の APIキーの登録を行います。変数名は `BARD_API_KEY` にしてください。変数の値にはOpenAIのAPIキーを入力します。 (OpenAIのホームページからAPIキーを取得できます。)

### Start using
1. このbotは新しいプルリクエストが作成されたときに自動的にコードレビューを行います。レビュー結果はプルリクエストのタイムラインやファイル変更部分に表示されます。
2. `git push` によりプルリクエストの更新が行われたときにも自動的にコードレビューを行います。
example:
[Bard-CodeReview/pull/21](https://github.com/anc95/Bard-CodeReview/pull/21)

### Using Github Actions
> 基本的には、Github Actions での利用を推奨します。
[actions/Bard-codereviewer](https://github.com/marketplace/actions/Bard-codereviewer)
1. `BARD_API_KEY` を設定する
2. 以下の例のように `.github/workflows/cr.yml` を作成する
```yml
name: Code Review
permissions:
contents: read
pull-requests: write
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
test:
if: ${{ contains(github.event.*.labels.*.name, 'gpt review') }} # Optional; to run only when a label is attached
runs-on: ubuntu-latest
steps:
- uses: anc95/Bard-CodeReview@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BARD_API_KEY: ${{ secrets.BARD_API_KEY }}
# Optional
LANGUAGE: Chinese
MODEL:
top_p: 1
temperature: 1
```
## Self-hosting
1. このリポジトリをクローンします
2. `.env.example` を `.env` にリネームし、必要な環境変数を設定します
3. 以下のコマンドを順番に実行することで依存関係をインストールし、botを起動します
```sh
npm i
npm -i g pm2
npm run build
pm2 start pm2.config.cjs
```
詳細は [probot](https://probot.github.io/docs/development/) を参照してください。
## Dev
### Setup
```sh
# Install dependencies
npm install
# Run the bot
npm start
```
### Docker
```sh
# 1. Build container
docker build -t cr-bot .
# 2. Start container
docker run -e APP_ID= -e PRIVATE_KEY= cr-bot
```
## Contributing
cr-bot の改善に関する提案やバグ報告は、issue を作成してください。どのような貢献でも歓迎します!!
より詳しい情報は [Contributing Guide](CONTRIBUTING.md) を参照してください。
## Credit
this project is inpired by [codereview.gpt](https://github.com/sturdy-dev/codereview.gpt)
## License
[ISC](LICENSE) © 2023 anc95