Skip to content

chore(security): 🔒 Codeball による PR承認 強化 - #487

Merged
genzouw merged 7 commits into
mainfrom
ai-codeball-approver-3102428679333915619
Aug 2, 2026
Merged

genzouw merged 7 commits into
mainfrom
ai-codeball-approver-3102428679333915619

Conversation

@genzouw

@genzouw genzouw commented Aug 2, 2026

Copy link
Copy Markdown
Owner

概要

OSS向けの無料AIコードレビューツールである Codeball (sturdy-dev/codeball-action) を導入し、PR作成時にAIがコードをレビューし、安全な変更と判断された場合に自動で承認(Approve)を行うよう設定を追加しました。

💡 What

  • .github/workflows/ai-codeball-approver.yml の新規作成
  • docs/security/ai-ci-tools.md に手動設定および導入背景のドキュメント追記

🎯 Why

  • コードレビューの自動化を促進し、開発速度と品質を向上させるため。
  • 他のレポジトリでも使える無料・オープンソースのCI/CDパイプラインプロトタイプ検証を目的としているため。

AIツール・CI/CD連携に関する手動セットアップ(必要な場合のみ)

  • なし(追加のAPIキー設定やシークレット登録は不要で、デフォルトの GITHUB_TOKEN を使用して動作します)

PR created automatically by Jules for task 3102428679333915619 started by @genzouw

Summary by CodeRabbit

  • 新機能

    • プルリクエスト作成・更新・再オープン時に、Codeballによる自動コードレビューを実行します。
    • 安全と判定された変更には、自動承認とラベル付与を行います。
  • ドキュメント

    • AIコードレビュー機能の設定方法、権限、認証に関する説明を追加しました。

Co-authored-by: genzouw <29957+genzouw@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions github-actions Bot added github-actions Pull requests that update GitHub Actions code docs labels Aug 2, 2026
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@genzouw, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 12 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c4bde508-c8ab-4674-81dd-57721b96b526

📥 Commits

Reviewing files that changed from the base of the PR and between 6224276 and 38066bc.

📒 Files selected for processing (2)
  • .github/workflows/ai-codeball-approver.yml
  • docs/security/ai-ci-tools.md
📝 Walkthrough

Walkthrough

GitHub Actions に Codeball Approver のワークフローを追加しました。プルリクエストの作成、更新、再オープン時に実行します。権限、ラベル、承認設定を定義し、設定内容をセキュリティ文書に追加しました。

Changes

Codeball 自動承認

Layer / File(s) Summary
ワークフローと設定説明
.github/workflows/ai-codeball-approver.yml, docs/security/ai-ci-tools.md
Codeball Approver をプルリクエストの作成、更新、再オープン時に実行します。読み取り専用のコンテンツ権限とプルリクエスト書き込み権限を設定します。承認時のラベル付与を有効にし、レビュー要求時のラベル付与とジョブ失敗を無効にします。設定方法と GITHUB_TOKEN の利用を文書化します。

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • genzouw/monopo#101: GitHub Actions による AI コードレビューと承認ツールを設定しています。
  • genzouw/monopo#106: docs/security/ai-ci-tools.md に AI/CI ツールの設定を追加しています。
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed タイトルは、CodeballによるPR自動承認ワークフローの追加という主要な変更を明確に示しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ai-codeball-approver-3102428679333915619

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

CodeballでPR自動レビュー/承認するGitHub Actionsを追加

⚙️ Configuration changes 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• PR作成/更新時にCodeballが自動レビューし、安全なら自動Approve
• Approve時にPRへラベル付与し、レビュー要求時は失敗させない
• 導入背景と手動セットアップ不要事項をセキュリティドキュメントへ追記
Diagram

graph TD
  A["PRイベント"] --> B["ai-codeball-approver.yml"] --> C["Codeball Action"] --> D["GitHub PR API"] --> E["Approve/Label"]
  B --> F["ai-ci-tools.md"]
  subgraph Legend
    direction LR
    _evt(["Event"]) ~~~ _wf(["Workflow"]) ~~~ _ext{{"External Action"}} ~~~ _api(["API"]) ~~~ _doc["Doc"]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Branch protection+必須レビュー/ステータスチェックで代替
  • ➕ 自動Approveに依存せず、運用ポリシーとして強制できる
  • ➕ ツール誤判定時のリスクを抑えやすい
  • ➖ レビュー負荷は減りにくい
  • ➖ OSSの軽量運用という目的に合わない場合がある
2. pull_request_targetで実行(書き込み権限を確実化)
  • ➕ フォークPRでもラベル/レビュー操作が可能になりやすい
  • ➖ フォーク由来のコード実行リスクが増えるため設計・防御が必須
  • ➖ セキュリティ審査が重くなる
3. 自動Approveをやめて“AIレビューコメント+ラベル”のみにする
  • ➕ 誤Approveの影響を抑えつつ自動化メリットを得られる
  • ➕ 人手レビューの最終ゲートを残せる
  • ➖ 承認までの時間短縮効果は小さくなる

Recommendation: 現行の pull_request トリガーで動かし、GITHUB_TOKEN範囲でApprove/ラベル付与する方針は、pull_request_targetより安全側で妥当です。まずは自動Approveの適用範囲(対象ブランチ/ラベル条件など)を運用で明確化し、誤判定が問題化した場合は“Approveなし・ラベルのみ”へ段階的に落とすのが現実的です。

Files changed (2) +28 / -0

Documentation (1) +7 / -0
ai-ci-tools.mdAI Codeball PR Approverの導入説明を追記 +7/-0

AI Codeball PR Approverの導入説明を追記

• Codeballを用いたPR自動レビュー/承認ワークフローの概要と導入背景を追記しました。追加のシークレット不要でGITHUB_TOKENで動作する旨を明記しています。

docs/security/ai-ci-tools.md

Other (1) +21 / -0
ai-codeball-approver.ymlCodeballによるPR自動Approveワークフローを追加 +21/-0

CodeballによるPR自動Approveワークフローを追加

• pull_request(opened/synchronize/reopened)をトリガーにCodeball Actionを実行するGitHub Actionsワークフローを新規作成しました。安全と判断された場合に自動Approveし、Approve時のみラベル付与する設定を追加しています。

.github/workflows/ai-codeball-approver.yml

@qodo-code-review

qodo-code-review Bot commented Aug 2, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 34 rules

Grey Divider


Action required

1. Top-level permissions欠如 ✓ Resolved 🐞 Bug ≡ Correctness
Description
.github/workflows/ai-codeball-approver.yml にトップレベル permissions: が無いため、既存の
permissions-audit.yml の「全ワークフローでトップレベル permissions 明示必須」チェックにより CI が失敗します。結果として本PRを入れると、main
向けPRで監査ジョブがブロックされます。
Code

.github/workflows/ai-codeball-approver.yml[R1-4]

+name: AI Codeball PR Approver
+
+on:
+  pull_request:
Relevance

●●● Strong

トップレベルpermissions明示は監査/最小権限方針で過去に受理。

PR-#106
PR-#350
PR-#135

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
permissions-audit は「トップレベルに permissions: が無い workflow をエラー」としており、新規 workflow はトップレベル
permissions: を持たないため監査に引っかかります。

.github/workflows/permissions-audit.yml[11-37]
.github/workflows/ai-codeball-approver.yml[1-21]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
新規ワークフロー `.github/workflows/ai-codeball-approver.yml` にトップレベル `permissions:` がありません。
このリポジトリにはワークフロー群を走査して `^permissions:` が無いファイルをエラーにする監査があるため、CI失敗につながります。

## Issue Context
- `permissions-audit.yml` は `grep -EL '^permissions:'` でトップレベル permissions 未定義の workflow を検出して失敗させます。
- 本ワークフローは job-level permissions のみ定義しています。

## Fix Focus Areas
- .github/workflows/ai-codeball-approver.yml[1-21]
- .github/workflows/permissions-audit.yml[11-37]

## Suggested change
`on:` ブロックの直後などに、最小権限のトップレベル permissions を追加してください(例: `contents: read`)。job-level の `pull-requests: write` はそのまま(または必要最小限に調整)でOKです。

```yml
permissions:
 contents: read
```

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Workflow変更PRも自動承認 ✓ Resolved 🐞 Bug ⛨ Security
Description
Codeball Approver は paths-ignore が無く全PRで動作するため、.github/workflows/**
を変更するPRでも自動Approveが試行され得ます。既存のAIレビューワークフローは .github/workflows/**
を明示的に除外しているため、本追加によりCI/セキュリティ設定変更に対する人的レビュー前提が弱まります。
Code

.github/workflows/ai-codeball-approver.yml[R3-6]

+on:
+  pull_request:
+    types: [opened, synchronize, reopened]
+
Relevance

●● Moderate

workflow変更PRの除外方針は示唆あるが、paths-ignore追加の前例が弱い。

PR-#389
PR-#178
PR-#332

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Codeball Approver は paths-ignore を持たず approvePullRequests: "true" で動作します。一方で既存の AI PR Reviewer は
.github/workflows/**paths-ignore しており、ワークフロー変更をAIレビュー対象から外す方針がコードで確認できます。

.github/workflows/ai-codeball-approver.yml[3-6]
.github/workflows/ai-codeball-approver.yml[15-19]
.github/workflows/ai-pr-reviewer.yml[3-9]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`.github/workflows/ai-codeball-approver.yml` は `pull_request` のみで `paths-ignore` がなく、workflowファイルを含むPRにも実行されます。
かつ `approvePullRequests: "true"` により、自動Approve対象になり得ます。

## Issue Context
このリポジトリ内の他のAI系PRレビューワークフローは、`.github/workflows/**` を `paths-ignore` で除外しており、workflow変更は人手レビューの対象として扱っている設計に見えます。

## Fix Focus Areas
- .github/workflows/ai-codeball-approver.yml[3-6]
- .github/workflows/ai-codeball-approver.yml[15-21]
- .github/workflows/ai-pr-reviewer.yml[3-9]

## Suggested change
以下のいずれか(または併用)で、workflow変更PRの自動Approveを防いでください。
1) `paths-ignore` に `.github/workflows/**` を追加
2) job/step に `if:` 条件を追加して、workflow変更を含む場合は approve しない

例:
```yml
on:
 pull_request:
   types: [opened, synchronize, reopened]
   paths-ignore:
     - '.github/workflows/**'
```

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. ドキュメント見出しが英語 ✗ Dismissed 📘 Rule violation § Compliance
Description
docs/security/ai-ci-tools.md の新規追記で見出し・本文に英語表現(例: `AI Codeball PR
Approver`)が含まれています。ドキュメント本文は原則日本語で記述する要件に反します。
Code

docs/security/ai-ci-tools.md[R122-125]

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

●●● Strong

docsの日本語表記統一は過去に受理されやすい。

PR-#131
PR-#154
PR-#358

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
ルールは docs 配下を含むプロジェクトドキュメント本文の説明・見出しを日本語で記述することを要求しています。今回の追記箇所に英語の見出し(`AI Codeball PR
Approver`)が含まれています。

Rule 748876: プロジェクトドキュメントは日本語で記述する
docs/security/ai-ci-tools.md[122-127]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
変更されたドキュメント本文に、英語の見出し・表現が含まれており、プロジェクトドキュメントは日本語で記述するルールに違反しています。

## Issue Context
ツール名自体(Codeball など)の固有名詞は残しても良い一方で、見出しや説明文としての英語フレーズは日本語化が求められます(例: 「AI Codeball PR Approver」→「AI Codeball によるPR自動承認」など)。

## Fix Focus Areas
- docs/security/ai-ci-tools.md[122-127]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. 要レビュー判定が見えない ✓ Resolved 🐞 Bug ◔ Observability
Description
Codeball が「人間のレビューが必要」と判定した場合でも、labelPullRequestsWhenReviewNeeded: "false"failJobsWhenReviewNeeded: "false"
により、ラベルも失敗も付かない設定です。これにより「承認されなかった理由(要レビューなのか、未実行/失敗なのか)」がPR上で判別しづらくなります。
Code

.github/workflows/ai-codeball-approver.yml[R18-21]

+          approvePullRequests: "true"
+          labelPullRequestsWhenApproved: "true"
+          labelPullRequestsWhenReviewNeeded: "false"
+          failJobsWhenReviewNeeded: "false"
Relevance

●● Moderate

review-needed時のラベル/失敗は運用方針次第で前例不足。

PR-#469
PR-#473
PR-#458

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
新規ワークフローでは review-needed 時のラベリング/失敗の両方が無効化されています。

.github/workflows/ai-codeball-approver.yml[18-21]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
現状の設定では、Codeball が review-needed と判断しても、PRにラベルが付かず、ジョブも失敗しません。
結果として PR UI 上で「Codeball が要レビューと言った」ことが機械的に追跡しづらくなります。

## Issue Context
該当する action input が両方 false になっています。

## Fix Focus Areas
- .github/workflows/ai-codeball-approver.yml[18-21]

## Suggested change
運用方針に合わせて少なくとも片方を有効化してください。
- 可視化重視: `labelPullRequestsWhenReviewNeeded: "true"`
- ゲート重視: `failJobsWhenReviewNeeded: "true"`

例:
```yml
with:
 labelPullRequestsWhenReviewNeeded: "true"
 failJobsWhenReviewNeeded: "true"
```

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

5. Docsがトリガー不完全 ✓ Resolved 🐞 Bug ⚙ Maintainability
Description
ドキュメントは「PR作成時」と記載していますが、実際のワークフローは opened に加えて synchronize / reopened
でも実行されます。ドキュメント上の期待と実挙動がずれるため、実行タイミング(特に更新時にも再Approveが走ること)を明記すべきです。
Code

docs/security/ai-ci-tools.md[R122-127]

+## 新規: AI Codeball PR Approver の設定
+
+PR作成時にAIがコードをレビューし、安全な変更と判断された場合に自動で承認(Approve)を行う `.github/workflows/ai-codeball-approver.yml` を追加しました。OSS向けの無料AIコードレビューツールである Codeball (`sturdy-dev/codeball-action`) を利用しています。
+
+1. **GitHub Secretsの設定**
+   - 追加のAPIキー設定やシークレット登録は不要です。デフォルトの `GITHUB_TOKEN` を使用して動作します。
Relevance

●●● Strong

ドキュメントと実トリガー不整合の修正は過去に受理。

PR-#375
PR-#478
PR-#455

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
ドキュメントはPR作成時のみを想起させる文言ですが、ワークフロー定義上は synchronize/reopened でも起動します。

docs/security/ai-ci-tools.md[122-127]
.github/workflows/ai-codeball-approver.yml[3-6]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`docs/security/ai-ci-tools.md` の Codeball Approver 説明が「PR作成時」となっており、実際の `pull_request.types`(opened/synchronize/reopened)を反映していません。

## Fix Focus Areas
- docs/security/ai-ci-tools.md[122-127]
- .github/workflows/ai-codeball-approver.yml[3-6]

## Suggested change
「PR作成時」に加えて「PR更新(コミット追加)時」「reopen時」も実行される旨を追記してください。

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Workflow名が英語表記 📘 Rule violation ☑ Accessibility
Description
GitHub Actions の name / job name が英語(AI Codeball PR Approver / `Codeball
Approver`)で記述されています。Actions 画面上の表示テキストとして日本語要件に反します。
Code

.github/workflows/ai-codeball-approver.yml[R1-2]

+name: AI Codeball PR Approver
+
Relevance

● Weak

Workflow名英語の指摘は過去に同様に却下されがち。

PR-#473
PR-#472
PR-#469

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
ルールは変更された UI テキスト(ラベル等)を日本語で記述することを要求しています。追加された workflow で name と job name が英語のまま追加されています。

Rule 748873: UI text must be written in Japanese
.github/workflows/ai-codeball-approver.yml[1-10]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
GitHub Actions の workflow 名・job 名が英語になっており、UIテキストは日本語で記述するというルールに違反しています。

## Issue Context
`.github/workflows/ai-codeball-approver.yml` は GitHub の Actions UI に表示されるため、英語表記が残ると運用者・利用者に対する UI テキスト要件違反となります。

## Fix Focus Areas
- .github/workflows/ai-codeball-approver.yml[1-10]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

Comment thread docs/security/ai-ci-tools.md
Comment thread .github/workflows/ai-codeball-approver.yml
Comment thread .github/workflows/ai-codeball-approver.yml
Comment thread .github/workflows/ai-codeball-approver.yml Outdated
Comment thread docs/security/ai-ci-tools.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ai-codeball-approver.yml:
- Around line 11-13: Update the top-level permissions in the workflow to include
only contents: read, and move pull-requests: write from the workflow level into
the codeball job’s permissions block. Preserve the existing codeball job
behavior while ensuring the workflow satisfies the permissions audit.
- Around line 11-13: Update the workflow permissions block to add issues: write
alongside the existing contents: read and pull-requests: write permissions,
enabling label creation, application, and removal when
labelPullRequestsWhenApproved is enabled.
- Line 16: Update the composite action referenced by the workflow’s
sturdy-dev/codeball-action@... entry so its baller, status, labeler, approver,
and suggester action references use immutable 40-character commit SHAs instead
of the mutable v2 tags. Preserve each action’s existing behavior and ensure all
internal Codeball references are pinned within the same supply chain.
- Line 16: Update the Codeball action reference in the workflow from the pinned
v2.6.0 SHA to a release or fork that supports the Node 20 runtime, and update
the adjacent version comment to match the new reference.
- Around line 17-21:
明示されていないlabelPullRequestsWhenCarefulReviewNeededの設定を、既存のCodeball入力設定の近くに追加してください。低信頼PRへcodeball:needs-careful-reviewラベルを付与しない意図なら値を"false"にし、付与する場合は意図した値を明示して、デフォルト値に依存しないようにしてください。

In `@docs/security/ai-ci-tools.md`:
- Line 124: Update the workflow description in ai-codeball-approver.yml
documentation to say the AI review and automatic approval run when a pull
request is created, updated, or reopened, replacing the narrower “when created”
wording while preserving the rest of the description.
- Around line 124-127: Update the GitHub Secrets section in the Codeball
documentation to state that GitHub Actions must enable “Allow GitHub Actions to
Create and Approve Pull Requests” for
`.github/workflows/ai-codeball-approver.yml` to use `pull-requests: write` for
approvals and labels, and note that fork pull requests may lack GITHUB_TOKEN
write permissions and therefore cannot be approved or labeled.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 223c106d-8373-45d1-b68e-98e955697bb4

📥 Commits

Reviewing files that changed from the base of the PR and between fae7d8d and 6224276.

📒 Files selected for processing (2)
  • .github/workflows/ai-codeball-approver.yml
  • docs/security/ai-ci-tools.md

Comment thread .github/workflows/ai-codeball-approver.yml
Comment thread .github/workflows/ai-codeball-approver.yml
Comment thread .github/workflows/ai-codeball-approver.yml Outdated
Comment thread docs/security/ai-ci-tools.md Outdated
Comment thread docs/security/ai-ci-tools.md Outdated
genzouw added 5 commits August 3, 2026 08:08
.github/workflows/ai-codeball-approver.yml にトップレベルの permissions が
無く、permissions-audit.yml の全ワークフロー監査(^permissions: の存在チェッ
ク)に失敗しmainへのマージがブロックされるため、トップレベルに
`permissions: contents: read` を追加。

また labelPullRequestsWhenApproved を有効化しているため、Codeball が
ラベル(codeball:approved 等)を作成・付与・削除する際に issues: write
権限が必要となるため、ジョブレベルのpermissionsに追加。

レビューコメント: #487 (comment), #487 (comment)
レビュアー: qodo-code-review, coderabbitai
優先度: critical
Codeball Approver は paths-ignore が無く全PRで動作するため、
.github/workflows/** を変更するPR(本ワークフロー自身の変更を含む)も
自動でApproveされ得た。既存の ai-pr-reviewer.yml 等はCI/セキュリティ設定
変更を人的レビュー必須として .github/workflows/** を明示的に除外している
ため、同じ設計方針に合わせて paths-ignore を追加。

レビューコメント: #487 (comment)
レビュアー: qodo-code-review
優先度: high
labelPullRequestsWhenReviewNeeded / failJobsWhenReviewNeeded が両方
false のため、Codeball が「要レビュー」と判定してもPR上に何の痕跡も
残らず、承認されなかった理由(要レビューなのか未実行/失敗なのか)が
判別できなかった。CIをブロックはせずラベルのみで可視化する方針とし、
labelPullRequestsWhenReviewNeeded を true に変更。

また labelPullRequestsWhenCarefulReviewNeeded も未指定でデフォルト値
(true) に依存していたため、意図を明示するため明示的に true を設定。

レビューコメント: #487 (comment), #487 (comment)
レビュアー: qodo-code-review, coderabbitai
優先度: medium
「PR作成時」という記載は、実際のワークフロー(.github/workflows/ai-codeball-approver.yml)
が opened に加えて synchronize / reopened でも実行される挙動を反映していな
かった。PR更新(コミット追加)時にも再度Approve判定が走ることが伝わるよ
う「PRの作成・更新・再オープン時」に修正。

レビューコメント: #487 (comment), #487 (comment)
レビュアー: qodo-code-review, coderabbitai
優先度: low
Codeball Approver は pull-requests: write / issues: write で承認とラベル
付与を行うが、リポジトリ側で「Allow GitHub Actions to create and approve
pull requests」が有効化されていないと動作しないこと、および fork PR では
GITHUB_TOKEN に書き込み権限が付与されないため自動承認・ラベル付与が行われ
ない場合があることがドキュメントに記載されていなかったため追記。

レビューコメント: #487 (comment)
レビュアー: coderabbitai
優先度: medium
@genzouw
genzouw enabled auto-merge (squash) August 2, 2026 23:14
@genzouw
genzouw merged commit 7074d96 into main Aug 2, 2026
36 of 37 checks passed
@genzouw
genzouw deleted the ai-codeball-approver-3102428679333915619 branch August 2, 2026 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs github-actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant