chore: GitHub Actions コスト最適化チェックを repo-maintenance に追加 - #564
Conversation
## 変更内容 ### claude.yml テンプレート - cancel-in-progress: true に変更(重複実行防止) - issues トリガーから assigned を削除 - bot ユーザー除外(github-actions, dependabot) - Draft PR でのトリガーをスキップ - timeout を 30分 → 20分に短縮 ### claude-code-review.yml テンプレート - synchronize トリガーを削除(push毎のレビュー実行防止) ### repo-maintenance.md - Step 3.6 に Claude Workflow Cost Optimization Check を追加 - 既存リポジトリの設定を自動チェック・修正を推奨 ## 背景 Elu-co-jp org で Claude Code ワークフローの過剰実行(1日64回等)が Actions 費用の最大要因(推定 $400+/3ヶ月)であったため、 全リポジトリに標準的なコスト最適化を適用する。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Step 3.6 を Claude 固有から汎用的な GitHub Actions コスト最適化に拡張: - 3.6.1: 全ワークフロー共通チェック(concurrency, timeout, Draft PR, paths フィルタ) - 3.6.2: Claude ワークフロー固有チェック(既存) - 3.6.3: CI/CD ワークフロー固有チェック(キャッシュ, paths, Dependabot制限) - 3.6.4: セキュリティワークフローの重複チェック(CodeQL重複, AIレビュー重複) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
repo-maintenance の Step 3.6 に以下のサブチェックを追加: - 3.6.5: Artifact 保持期間チェック - upload-artifact の retention-days 未設定(デフォルト90日)を検出 - 30日以下の設定を推奨 - 3.6.6: 未使用ワークフロー検出 - 30日以上実行のないワークフローの検出・無効化提案 - schedule トリガーの棚卸し - 直近5回全て失敗しているワークフローの検出 - 3.6.7: Actions Runner サイズチェック - Large Runner / Windows / macOS の使用を検出 - コスト比較表を提示し、Linux代替を提案 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR optimizes GitHub Actions configuration by replacing Renovate/Dependabot checks with comprehensive cost optimization guidance in maintenance documentation, refining Claude workflow triggers to exclude bot actions and draft PRs, and reducing Claude workflow timeout from 30 to 20 minutes. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 640723fee2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| github.actor != 'dependabot[bot]' && | ||
| ( | ||
| (github.event_name == 'issue_comment' && contains(github.event.comment.body || '', '@claude') && | ||
| !(github.event.issue.pull_request && github.event.issue.pull_request.url && github.event.issue.draft == true)) || |
There was a problem hiding this comment.
Use a real draft signal for issue_comment gating
The new Draft PR skip guard for issue_comment is ineffective because github.event.issue.draft is not populated on issue_comment payloads (the issue object only carries a pull_request link block), so github.event.issue.draft == true never matches and comments with @claude on draft PRs still run this workflow. In repositories that rely on draft mode to suppress automation, this reintroduces the very unnecessary executions this change is trying to prevent.
Useful? React with 👍 / 👎.
|
(aside) |
|
Claude finished @keito4's task in 4m 35s —— View job 調査完了・修正不可の理由説明
🔍 CI失敗の根本原因エラー: 発生メカニズム
これは 悪意ある PR がワークフローを改ざんして権限昇格するのを防ぐ セキュリティ機能です。
❌ 修正できない理由根本的な制約: さらに、私(Claude)は ✅ 対処方法
推奨:
|
|
🎉 This PR is included in version 1.94.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
claude.yml,claude-code-review.yml)をコスト最適化版に更新repo-maintenanceの Step 3.6 に GitHub Actions コスト最適化チェックを新設背景
Elu-co-jp org の請求調査で、Claude Code ワークフローの過剰実行(1日64回)や非効率な CI 設定が Actions 費用の最大要因($615/3ヶ月)であることが判明。全リポジトリに標準的なコスト最適化を適用するため、config テンプレートとメンテナンスチェックを更新する。
変更内容
claude.ymlテンプレートcancel-in-progress: true(重複実行防止)issuesトリガーからassignedを削除claude-code-review.ymlテンプレートsynchronizeトリガーを削除(push毎のレビュー実行防止)repo-maintenance.md— Step 3.6 新設Test plan
/repo-maintenance --mode check-onlyで新チェックが実行されること/repo-maintenance --mode fullで問題検出時に修正提案が表示されること🤖 Generated with Claude Code
Summary by CodeRabbit