File tree Expand file tree Collapse file tree 3 files changed +53
-11
lines changed
Expand file tree Collapse file tree 3 files changed +53
-11
lines changed Original file line number Diff line number Diff line change 2222 - uses : anthropics/claude-code-action@edd85d61533cbba7b57ed0ca4af1750b1fdfd3c4 # v1
2323 with :
2424 anthropic_api_key : ${{ secrets.ANTHROPIC_API_KEY }}
25+ allowed_bots : " next-lift-merge-master"
2526 prompt : |
2627 このPRの変更内容を分析し、ドキュメント更新漏れがないかチェックしてください。
2728
Original file line number Diff line number Diff line change 11{
22 "$schema" : " https://openapi.vercel.sh/vercel.json" ,
33 "git" : {
4- "deploymentEnabled" : {
5- "main" : true ,
6- "feature/**/*" : false ,
7- "bugfix/**/*" : false ,
8- "refactor/**/*" : false ,
9- "infra/**/*" : false ,
10- "chore/**/*" : false ,
11- "deps/**/*" : false ,
12- "docs/**/*" : false ,
13- "improve/**/*" : false
14- }
4+ "deploymentEnabled" : false
155 }
166}
Original file line number Diff line number Diff line change 1+ # CI-1: Document Reviewワークフローの失敗率が高い
2+
3+ ** 対象** : ` .github/workflows/document-review.yml `
4+ ** 優先度** : 高
5+
6+ ## 問題
7+
8+ Document Reviewワークフローが約39%の確率で失敗している(直近50ランで成功17件 / 失敗11件 / スキップ12件)。失敗には2つのパターンがある。
9+
10+ ### パターン1: Bot起因のトリガー拒否(失敗の64%)
11+
12+ ` merge-master.yml ` ワークフローが` next-lift-merge-master ` GitHub Appのトークンを使ってmainブランチをPRブランチにマージすると、` pull_request: synchronize ` イベントが発火してDocument Reviewが起動する。` anthropics/claude-code-action ` はデフォルトでBot起因の実行を拒否するため、即座に失敗する(実行時間8〜15秒)。
13+
14+ ```
15+ Action failed with error: Workflow initiated by non-human actor: next-lift-merge-master (type: Bot).
16+ Add bot to allowed_bots list or use '*' to allow all bots.
17+ ```
18+
19+ ### パターン2: Claude実行エラー(失敗の36%)
20+
21+ Claude APIとの通信途中で失敗する一時的なエラー。実行時間1分程度で、同じPRの再実行で成功することから、APIの一時障害と推測される。
22+
23+ ```
24+ Action failed with error: Claude execution failed: Execution failed:
25+ ```
26+
27+ ## 修正内容
28+
29+ ### パターン1の修正
30+
31+ ` claude-code-action ` の` allowed_bots ` パラメータに` next-lift-merge-master ` を追加する。エラーメッセージで案内されている公式パラメータであり、` '*' ` (全Bot許可)ではなく特定のBotのみ許可することでセキュリティを維持する。
32+
33+ ``` yaml
34+ - uses : anthropics/claude-code-action@edd85d61533cbba7b57ed0ca4af1750b1fdfd3c4 # v1
35+ with :
36+ anthropic_api_key : ${{ secrets.ANTHROPIC_API_KEY }}
37+ allowed_bots : " next-lift-merge-master"
38+ ` ` `
39+
40+ ### パターン2の対応
41+
42+ 経過観察とする。発生頻度が低く(50ラン中4件、約8%)、一時的なAPI障害が原因であり再実行で解決する。パターン1を修正すれば全体の失敗率は39%から約8%に改善される。
43+
44+ ## 対象ファイル
45+
46+ - ` .github/workflows/document-review.yml`
47+
48+ # # 検証方法
49+
50+ - ` next-lift-merge-master` Botによるマージ後にDocument Reviewが正常に実行されること
51+ - Bot起因のトリガー拒否エラーが発生しなくなること
You can’t perform that action at this time.
0 commit comments