fix: required status checks を実際の CI ジョブ名に合わせる - #581
Conversation
- setup-team-protection.sh の contexts を "CI" → "Quality Gate" に変更 Quality Gate ジョブが全チェックを集約し if: always() で常に実行されるため最適 - Next.js プロジェクト向けに pre-production/production ブランチの保護を推奨に追加 - repo-maintenance の必須ジョブ参照を Quality Gate ベースに更新 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds framework-aware branch protection that detects Next.js projects and applies strict protection to main, pre-production, and production; replaces required status check label "CI" with "Quality Gate" across docs and setup scripts; small test update to skip specified workflows. Changes
Sequence Diagram(s)sequenceDiagram
rect rgba(200,200,255,0.5)
participant CLI as CLI
participant Script as setup-team-protection.sh
participant GitHub as GitHub API
participant Repo as Repository
end
CLI->>Script: run protection setup (repo, options)
Script->>Repo: read package.json
alt Next.js detected
Script->>Script: set PROTECT_BRANCHES = main,pre-production,production\nset PROTECTION_LEVEL = strict
else Not Next.js
Script->>Script: set PROTECT_BRANCHES = main\nset PROTECTION_LEVEL = standard
end
Script->>GitHub: call Branch Protection API\n(required_check: "Quality Gate")
GitHub-->>Script: confirmation
Script-->>CLI: report result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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 |
🔍 AI Code Review (Local Hook)Models: Codex (default) / Gemini (default) 🤖 Codex Review指摘事項なし。 補足:
判定: patch is correct 🤖 Generated by post_pr_ai_review.py hook |
🔍 AI Code Review (Local Hook)Models: Codex (default) / Gemini (default) 🤖 Codex Review指摘事項
補足: 同じ誤りが手順書にもあり、運用時に誤設定を誘発します。 Overall
|
|
(aside) |
|
I'll analyze this and get back to you. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.claude/commands/repo-maintenance.md:
- Around line 287-306: The doc's framework-detection sets
PROTECT_BRANCHES/PROTECTION_LEVEL but the target script
script/setup-team-protection.sh expects CLI args --branches and
--protection-level; update the example to invoke that script and pass the
computed values as CLI arguments (use the IS_NEXTJS logic to compute values,
then call script/setup-team-protection.sh with --branches set to the
PROTECT_BRANCHES value and --protection-level set to the PROTECTION_LEVEL
value), or alternatively modify script/setup-team-protection.sh to accept
fallback environment variables PROTECT_BRANCHES and PROTECTION_LEVEL when those
CLI flags are not provided.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 33f10141-4e50-40a9-8d64-16ad5069fb50
📒 Files selected for processing (3)
.claude/commands/repo-maintenance.md.claude/commands/setup-team-protection.mdscript/setup-team-protection.sh
| **フレームワーク検出による保護ブランチの自動判定:** | ||
|
|
||
| ```bash | ||
| # Next.js プロジェクトかどうかを検出 | ||
| IS_NEXTJS=false | ||
| if [ -f "package.json" ]; then | ||
| if jq -e '.dependencies.next // .devDependencies.next' package.json &>/dev/null; then | ||
| IS_NEXTJS=true | ||
| fi | ||
| fi | ||
|
|
||
| # Next.js の場合は pre-production / production も保護対象 | ||
| if [ "$IS_NEXTJS" = true ]; then | ||
| PROTECT_BRANCHES="main,pre-production,production" | ||
| PROTECTION_LEVEL="strict" | ||
| else | ||
| PROTECT_BRANCHES="main" | ||
| PROTECTION_LEVEL="standard" | ||
| fi | ||
| ``` |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check if setup-team-protection.sh reads PROTECT_BRANCHES or PROTECTION_LEVEL env vars
rg -n 'PROTECT_BRANCHES|:-\$\{?PROTECT|:-\$\{?PROTECTION_LEVEL' script/setup-team-protection.sh || echo "No env var reads found - confirms the issue"Repository: keito4/config
Length of output: 100
🏁 Script executed:
rg -n '\-\-branches|\-\-protection-level' script/setup-team-protection.sh | head -20Repository: keito4/config
Length of output: 277
Environment variables are not read by the target script.
The framework detection logic sets PROTECT_BRANCHES and PROTECTION_LEVEL as environment variables, but script/setup-team-protection.sh does not read these. The script only accepts --branches and --protection-level as CLI arguments (lines 64 and 80 of the script).
Either:
- Update this command doc to pass CLI arguments instead of setting env vars, or
- Update the script to fallback to environment variables
Option 1: Use CLI arguments (recommended)
# Next.js プロジェクトかどうかを検出
IS_NEXTJS=false
if [ -f "package.json" ]; then
if jq -e '.dependencies.next // .devDependencies.next' package.json &>/dev/null; then
IS_NEXTJS=true
fi
fi
# Next.js の場合は pre-production / production も保護対象
if [ "$IS_NEXTJS" = true ]; then
- PROTECT_BRANCHES="main,pre-production,production"
- PROTECTION_LEVEL="strict"
+ bash script/setup-team-protection.sh \
+ --branches main,pre-production,production \
+ --create-branches \
+ --protection-level strict
else
- PROTECT_BRANCHES="main"
- PROTECTION_LEVEL="standard"
+ bash script/setup-team-protection.sh \
+ --branches main \
+ --protection-level standard
fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| **フレームワーク検出による保護ブランチの自動判定:** | |
| ```bash | |
| # Next.js プロジェクトかどうかを検出 | |
| IS_NEXTJS=false | |
| if [ -f "package.json" ]; then | |
| if jq -e '.dependencies.next // .devDependencies.next' package.json &>/dev/null; then | |
| IS_NEXTJS=true | |
| fi | |
| fi | |
| # Next.js の場合は pre-production / production も保護対象 | |
| if [ "$IS_NEXTJS" = true ]; then | |
| PROTECT_BRANCHES="main,pre-production,production" | |
| PROTECTION_LEVEL="strict" | |
| else | |
| PROTECT_BRANCHES="main" | |
| PROTECTION_LEVEL="standard" | |
| fi | |
| ``` | |
| # Next.js プロジェクトかどうかを検出 | |
| IS_NEXTJS=false | |
| if [ -f "package.json" ]; then | |
| if jq -e '.dependencies.next // .devDependencies.next' package.json &>/dev/null; then | |
| IS_NEXTJS=true | |
| fi | |
| fi | |
| # Next.js の場合は pre-production / production も保護対象 | |
| if [ "$IS_NEXTJS" = true ]; then | |
| bash script/setup-team-protection.sh \ | |
| --branches main,pre-production,production \ | |
| --create-branches \ | |
| --protection-level strict | |
| else | |
| bash script/setup-team-protection.sh \ | |
| --branches main \ | |
| --protection-level standard | |
| fi |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.claude/commands/repo-maintenance.md around lines 287 - 306, The doc's
framework-detection sets PROTECT_BRANCHES/PROTECTION_LEVEL but the target script
script/setup-team-protection.sh expects CLI args --branches and
--protection-level; update the example to invoke that script and pass the
computed values as CLI arguments (use the IS_NEXTJS logic to compute values,
then call script/setup-team-protection.sh with --branches set to the
PROTECT_BRANCHES value and --protection-level set to the PROTECTION_LEVEL
value), or alternatively modify script/setup-team-protection.sh to accept
fallback environment variables PROTECT_BRANCHES and PROTECTION_LEVEL when those
CLI flags are not provided.
dependabot-auto-merge.yml と release-drafter.yml はリポジトリの チェックアウトが不要なため、checkout action のチェックから除外 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
🎉 This PR is included in version 1.97.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |

Summary
setup-team-protection.shの required status checks を"CI"→"Quality Gate"に修正。Quality Gate ジョブはif: always()で常に実行され全チェックを集約するため、paths フィルタでスキップされても "Waiting for status" にならないpre-production/productionブランチの保護を推奨設定として追加repo-maintenanceの必須ジョブ参照を Quality Gate ベースに更新Test plan
setup-team-protection.sh --dry-runでQuality Gateが contexts に含まれることを確認/repo-maintenance実行時に pre-production/production の保護が提案されることを確認🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Tests