Skip to content
Merged
28 changes: 28 additions & 0 deletions .github/workflows/ai-codeball-approver.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: AI Codeball PR Approver

on:
pull_request:
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
types: [opened, synchronize, reopened]
paths-ignore:
- '.github/workflows/**'

permissions:
contents: read

Comment thread
qodo-code-review[bot] marked this conversation as resolved.
jobs:
codeball:
runs-on: ubuntu-latest
name: Codeball Approver
permissions:
contents: read
issues: write
pull-requests: write
Comment thread
coderabbitai[bot] marked this conversation as resolved.
steps:
- name: Codeball
uses: sturdy-dev/codeball-action@102067b9f537482cee112577655c85fda56d8926 # v2.6.0
Comment thread
genzouw marked this conversation as resolved.
with:
approvePullRequests: 'true'
labelPullRequestsWhenApproved: 'true'
labelPullRequestsWhenReviewNeeded: 'true'
labelPullRequestsWhenCarefulReviewNeeded: 'true'
failJobsWhenReviewNeeded: 'false'
11 changes: 11 additions & 0 deletions docs/security/ai-ci-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,14 @@ PR作成時にGitHub Models (o3-mini) を利用して、PRテンプレートに

1. **GitHub Secretsの設定 (必須)**
- リポジトリ管理者が `Settings > Secrets and variables > Actions` にて `GH_MODELS_TOKEN` を登録している必要があります。

## 新規: AI Codeball PR Approver の設定

PRの作成・更新・再オープン時にAIがコードをレビューし、安全な変更と判断された場合に自動で承認(Approve)を行う `.github/workflows/ai-codeball-approver.yml` を追加しました。OSS向けの無料AIコードレビューツールである Codeball (`sturdy-dev/codeball-action`) を利用しています。

Comment thread
qodo-code-review[bot] marked this conversation as resolved.
1. **GitHub Secretsの設定**
- 追加のAPIキー設定やシークレット登録は不要です。デフォルトの `GITHUB_TOKEN` を使用して動作します。
Comment thread
qodo-code-review[bot] marked this conversation as resolved.

2. **リポジトリ設定 (必須)**
- `.github/workflows/ai-codeball-approver.yml` はPRの自動承認・ラベル付与のために `pull-requests: write` / `issues: write` を利用します。これを機能させるには、リポジトリの `Settings > Actions > General > Workflow permissions` にて `Allow GitHub Actions to create and approve pull requests` を有効にしてください。
- フォークからのPR(`pull_request` イベント)では `GITHUB_TOKEN` に書き込み権限が付与されないため、フォークPRに対しては自動承認・ラベル付与が行われない場合があります。
Loading