fix: Claude CI 自己キャンセル防止・enforce_admins 修正・ヘルスチェック追加 - #619
Conversation
Closes #616, Closes #617, Closes #618 #617: claude.yml の concurrency 自己キャンセル問題 - claude[bot] を actor フィルターに追加し、応答コメントによる ワークフロー自己キャンセルを防止 #616: enforce_admins デフォルトを false に変更 - setup-team-protection の main ブランチ保護で enforce_admins=false に - 管理者が自身の PR をマージできない問題を解消 #618: Claude Code OAuth ヘルスチェックワークフローテンプレート追加 - 毎週月曜にトークン有効性を確認 - 失敗時に Issue を自動作成(重複防止付き) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR implements three fixes addressing token validation, admin enforcement defaults, and workflow actor filtering: updates Changes
Sequence Diagram(s)sequenceDiagram
participant GA as GitHub Actions<br/>(Scheduled/Manual)
participant CCA as Claude Code Action
participant OAuth as Claude OAuth API
participant GH as GitHub API
GA->>CCA: Trigger health-check with OAUTH_TOKEN
CCA->>OAuth: Validate token (direct_prompt: "OK")
alt Token Valid
OAuth-->>CCA: Success (Reply: "OK")
CCA-->>GA: Step succeeds
GA->>GA: Skip issue creation
else Token Invalid/Expired
OAuth-->>CCA: Error
CCA-->>GA: Step fails (continue-on-error)
GA->>GH: Check for existing open issues<br/>(label: claude-health)
alt Issue Exists
GH-->>GA: Found open issue
GA->>GA: Exit (no duplicate)
else No Issue Exists
GH-->>GA: No open issue
GA->>GH: Create new issue<br/>(Japanese title & labels)
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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: b5b09248e6
ℹ️ 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".
| # Default branch: admin enforcement, no mandatory reviews | ||
| enforce_admins=true | ||
| # Default branch: no admin enforcement, no mandatory reviews | ||
| enforce_admins=false |
There was a problem hiding this comment.
Respect --enforce-admins for default branch
The main|master branch defaults now unconditionally set enforce_admins=false, which overrides an explicit --enforce-admins invocation (ENFORCE_ADMINS=true). In the default non---uniform path, an operator can request admin enforcement and still end up with admins exempt from protection on the default branch, which weakens branch protection contrary to the CLI option contract.
Useful? React with 👍 / 👎.
|
|
||
| gh issue create \ | ||
| --title "fix: Claude Code OAuth トークンが無効です" \ | ||
| --label "claude-health,bug" \ |
There was a problem hiding this comment.
Remove undeclared label from health-check issue creation
The failure handler always passes --label "claude-health,bug", but this repository’s label definitions (.github/labels.yml and templates/github/labels.yml) do not include claude-health. GitHub’s labeling guidance requires labels to exist before being added via gh, so in repos generated from these templates the alert-creation step can fail exactly when the health check detects an invalid token, preventing the intended notification.
Useful? React with 👍 / 👎.
|
🎉 This PR is included in version 1.105.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Closes #616, Closes #617, Closes #618
3件の CI 関連 Issue をまとめて修正。
変更内容
#617: claude.yml の concurrency 自己キャンセル問題
claude[bot]を actor フィルターに追加claude[bot]の応答コメントがワークフローをトリガーし、実行中のジョブを自己キャンセルしていた問題を修正#616: enforce_admins デフォルトを false に変更
setup-team-protectionの main ブランチ保護でenforce_admins=falseをデフォルトに.claude/commands/setup-team-protection.md,script/setup-team-protection.sh#618: Claude Code OAuth ヘルスチェックワークフロー追加
templates/workflows/claude-health-check.ymlを新規追加claude-healthラベルで既存チェック)Test plan
claude[bot]コメントでワークフローがトリガーされないこと🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Changes