Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
197 changes: 160 additions & 37 deletions .claude/commands/repo-maintenance.md
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,124 @@ MODE が `full` かつ CI/CD が未設定の場合:

`/setup-ci` コマンドの実行を提案。

### 3.5.1 CI Workflow Template Sync Check

`templates/workflows/` のテンプレートと `.github/workflows/` の実ファイルを比較し、乖離を検出:

**確認ロジック:**

```bash
for f in templates/workflows/*.yml; do
base=$(basename "$f")
actual=".github/workflows/$base"
if [ -f "$actual" ]; then
if ! diff -q "$f" "$actual" > /dev/null 2>&1; then
echo "DIFF: $base — テンプレートと実ファイルが乖離"
fi
else
echo "MISS: $base — テンプレートはあるがワークフロー未配置"
fi
done
Comment on lines +710 to +720

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether unmatched globs are handled before loops
rg -n -C2 'for f in (templates/workflows/\*\.yml|\.github/workflows/templates/\*\.yml)' .claude/commands/repo-maintenance.md
rg -n -C2 'nullglob' .claude/commands/repo-maintenance.md

Repository: keito4/config

Length of output: 430


🏁 Script executed:

#!/bin/bash
# Verify the exact content at the specified line ranges
sed -n '705,725p' .claude/commands/repo-maintenance.md
echo "---"
sed -n '800,815p' .claude/commands/repo-maintenance.md

Repository: keito4/config

Length of output: 866


🏁 Script executed:

#!/bin/bash
# Check if the directories referenced in the globs actually exist
ls -la templates/workflows/ 2>&1 | head -20
echo "---"
ls -la .github/workflows/templates/ 2>&1 | head -20

Repository: keito4/config

Length of output: 959


Add nullglob to handle empty template directories safely.

Without shopt -s nullglob, unmatched glob patterns expand to literal strings (templates/workflows/*.yml), causing:

  • Line 710-720: Silent misdetection if templates/workflows/ is empty
  • Line 804-808: Grep errors if .github/workflows/templates/ is empty

Directories currently exist with files, but the code lacks resilience to future emptying or misconfiguration.

🔧 Suggested fix
+shopt -s nullglob
+
 for f in templates/workflows/*.yml; do
   base=$(basename "$f")
   actual=".github/workflows/$base"
@@ -716,0 +720,2 @@
 done
+
+shopt -u nullglob

Also applies to: 804–808

🤖 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 710 - 720, Enable bash
nullglob before any glob-based loops/greps and disable it afterward to avoid
literal unmatched-glob strings; specifically, add shopt -s nullglob before the
loop that starts with "for f in templates/workflows/*.yml; do" (and before the
code that greps .github/workflows/templates/) so empty directories produce no
matches instead of literal patterns, and restore the original state with shopt
-u nullglob (or save/restore with shopt -p) after those blocks.

```

**結果:**

- ✅ 全テンプレートと一致
- ⚠️ 乖離あり → diff を表示し、テンプレート更新 or ワークフロー更新を提案
- 📝 未配置テンプレートあり → 配置を提案(stale.yml 等はオプションのため確認のみ)

**MODE が `full` の場合:**

乖離しているファイルごとに:

1. `diff templates/workflows/$base .github/workflows/$base` を表示
2. テンプレートを実ファイルに反映するか確認
3. 承認された場合 `cp templates/workflows/$base .github/workflows/$base` を実行

### 3.5.2 CI Workflow Consistency Check

ワークフロー間の設定整合性を検証:

**チェック項目:**

| # | チェック | 確認方法 | 推奨 |
| --- | -------------------------------------- | --------------------------------------------------------------------------- | ------------------------------ |
| 1 | Node.js バージョン統一 | `grep -rh 'node-version' .github/workflows/*.yml` と `.node-version` を比較 | `.node-version` の値と一致 |
| 2 | Actions バージョン統一 | 同一アクションのバージョンがワークフロー間で一致しているか | 全ワークフローで同一バージョン |
| 3 | ジョブ名・ステータスチェック名の一貫性 | Required Status Checks に使われるジョブ名が正しいか | `Quality Gate` 等の統一名 |
| 4 | Runner バージョン | `runs-on` の値がワークフロー間で一貫しているか | `ubuntu-latest` に統一 |
Comment on lines +743 to +748

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify that a concrete check exists for required status checks / job-name consistency
rg -n -C3 'ジョブ名・ステータスチェック名|Required Status Checks|Quality Gate' .claude/commands/repo-maintenance.md
rg -n -C3 'branch protection|required_status_checks|contexts|jobs:' .claude/commands/repo-maintenance.md

Repository: keito4/config

Length of output: 1909


🏁 Script executed:

sed -n '750,779p' .claude/commands/repo-maintenance.md

Repository: keito4/config

Length of output: 1084


The documented check for job/status check name consistency (line 747) has no corresponding implementation in the validation script.

The confirmation logic (lines 750–779) includes checks for Node.js versions, Actions versions, and Runner versions, but completely omits validation for the job name/status check consistency documented in line 747 (ジョブ名・ステータスチェック名の一貫性). This creates a false confidence that all four checks are being performed when only three are actually implemented.

Add a validation block to verify that job names used in Required Status Checks are consistent with workflow job IDs.

🤖 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 743 - 748, Add a
validation block that verifies "ジョブ名・ステータスチェック名の一貫性" by cross-checking workflow
job IDs against branch protection required status check contexts: enumerate job
IDs from parsed workflows and compare them to the strings in
required_status_checks.contexts, flagging any contexts that don't match an
existing workflow job ID (and vice versa). Integrate this into the existing
validation routine that performs Node.js/Actions/Runner checks so it runs
alongside those checks, and surface clear error messages referencing the
mismatched context and the workflow file/job id (e.g., mention "Quality Gate" if
present) so maintainers can correct either the workflow job name or branch
protection setting.


**確認ロジック:**

```bash
# Node.js バージョン整合性
NODE_FILE_VER=$(cat .node-version 2>/dev/null | cut -d. -f1)
WORKFLOW_VERS=$(grep -rh 'node-version' .github/workflows/*.yml \
| sed "s/.*node-version[: ]*['\"]*//" | sed "s/['\"].*//" | sort -u)
for v in $WORKFLOW_VERS; do
if [ "$v" != "$NODE_FILE_VER" ] && [ "$v" != "$(cat .node-version)" ]; then
echo "MISMATCH: workflow uses node $v, .node-version is $(cat .node-version)"
Comment on lines +758 to +759

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Guard Node check when .node-version is missing

The mismatch condition calls $(cat .node-version) inside the loop without a file-existence guard. In repositories that set node-version in workflows but do not track a .node-version file, this emits No such file errors and flags every workflow version as mismatched, so the consistency check becomes false-positive noise. Gate this logic on -f .node-version (or compute one fallback value once) before iterating.

Useful? React with 👍 / 👎.

fi
Comment on lines +754 to +760

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify current parsing logic and likely mismatch-prone patterns
rg -n -C2 'NODE_FILE_VER|WORKFLOW_VERS|node-version' .claude/commands/repo-maintenance.md

Repository: keito4/config

Length of output: 1229


🏁 Script executed:

cat .node-version

Repository: keito4/config

Length of output: 64


🏁 Script executed:

find .github/workflows -name "*.yml" -o -name "*.yaml" | head -20

Repository: keito4/config

Length of output: 805


🏁 Script executed:

grep -rh 'node-version' .github/workflows/ 2>/dev/null | head -20

Repository: keito4/config

Length of output: 658


🏁 Script executed:

grep -rh 'node-version' .github/workflows/*.yml | head -30

Repository: keito4/config

Length of output: 490


🏁 Script executed:

grep -rh 'node-version' .github/workflows/*.yml | \
  sed "s/.*node-version[: ]*['\"]*//" | sed "s/['\"].*//" | sort -u

Repository: keito4/config

Length of output: 60


🏁 Script executed:

grep -rh 'node-version' .github/workflows/ | grep -E "v[0-9]|'v" | head -10

Repository: keito4/config

Length of output: 39


🏁 Script executed:

cat .github/workflows/ci.yml | grep -A2 -B2 'node-version'

Repository: keito4/config

Length of output: 419


Normalize Node version values before comparison.

Current comparison can mis-detect when .node-version contains formats like v22.14.0 or trailing spaces. While the current file uses a clean format (22.22.0), the parsing logic extracts only the first version segment and doesn't account for prefixes or whitespace, which could cause false positives if the file format changes.

🔧 Suggested fix
-NODE_FILE_VER=$(cat .node-version 2>/dev/null | cut -d. -f1)
+NODE_FILE_RAW=$(tr -d '[:space:]' < .node-version 2>/dev/null)
+NODE_FILE_VER=$(echo "$NODE_FILE_RAW" | sed -E 's/^v//' | cut -d. -f1)
@@
-for v in $WORKFLOW_VERS; do
-  if [ "$v" != "$NODE_FILE_VER" ] && [ "$v" != "$(cat .node-version)" ]; then
-    echo "MISMATCH: workflow uses node $v, .node-version is $(cat .node-version)"
+for v in $WORKFLOW_VERS; do
+  WV=$(echo "$v" | tr -d '[:space:]' | sed -E "s/^['\"]|['\"]$//g; s/^v//" | cut -d. -f1)
+  if [ -n "$NODE_FILE_VER" ] && [ "$WV" != "$NODE_FILE_VER" ]; then
+    echo "MISMATCH: workflow uses node $v, .node-version is $NODE_FILE_RAW"
   fi
 done
📝 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.

Suggested change
NODE_FILE_VER=$(cat .node-version 2>/dev/null | cut -d. -f1)
WORKFLOW_VERS=$(grep -rh 'node-version' .github/workflows/*.yml \
| sed "s/.*node-version[: ]*['\"]*//" | sed "s/['\"].*//" | sort -u)
for v in $WORKFLOW_VERS; do
if [ "$v" != "$NODE_FILE_VER" ] && [ "$v" != "$(cat .node-version)" ]; then
echo "MISMATCH: workflow uses node $v, .node-version is $(cat .node-version)"
fi
NODE_FILE_RAW=$(tr -d '[:space:]' < .node-version 2>/dev/null)
NODE_FILE_VER=$(echo "$NODE_FILE_RAW" | sed -E 's/^v//' | cut -d. -f1)
WORKFLOW_VERS=$(grep -rh 'node-version' .github/workflows/*.yml \
| sed "s/.*node-version[: ]*['\"]*//" | sed "s/['\"].*//" | sort -u)
for v in $WORKFLOW_VERS; do
WV=$(echo "$v" | tr -d '[:space:]' | sed -E "s/^['\"]|['\"]$//g; s/^v//" | cut -d. -f1)
if [ -n "$NODE_FILE_VER" ] && [ "$WV" != "$NODE_FILE_VER" ]; then
echo "MISMATCH: workflow uses node $v, .node-version is $NODE_FILE_RAW"
fi
done
🤖 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 754 - 760, Normalize the
node versions before comparing: read and trim .node-version into NODE_FILE_VER
(remove leading "v" and surrounding whitespace), normalize each value in
WORKFLOW_VERS the same way (strip any leading "v" prefix and whitespace) in the
extraction pipeline that builds WORKFLOW_VERS, and then use those normalized
values in the loop that checks for mismatches (the for v in $WORKFLOW_VERS loop
and the comparison against NODE_FILE_VER and $(cat .node-version)). Ensure both
sides of the comparison use the same normalization logic so prefixes like "v" or
trailing spaces won't trigger false mismatches.

done

# Actions バージョン統一
grep -rh 'uses:' .github/workflows/*.yml \
| sed 's/.*uses: *//' | sort | uniq -c | sort -rn \
| awk '{print $2}' | sed 's/@.*//' | sort -u \
| while read action; do
versions=$(grep -rh "uses: *${action}@" .github/workflows/*.yml \
| sed "s/.*@//" | sort -u)
count=$(echo "$versions" | wc -l)
if [ "$count" -gt 1 ]; then
echo "INCONSISTENT: $action has multiple versions: $(echo $versions | tr '\n' ', ')"
fi
done

# Runner バージョン
grep -rh 'runs-on:' .github/workflows/*.yml \
| sed 's/.*runs-on: *//' | sort | uniq -c | sort -rn
```

**結果:**

- ✅ 全ワークフロー間で一貫性あり
- ⚠️ 不一致あり → 具体的なファイル名・行番号・推奨値を表示

**MODE が `full` の場合:**

不一致ごとに修正を提案し、承認後に自動修正を実行。

### 3.5.3 CI Template Deployment Check (他リポジトリ展開)

config リポジトリのテンプレートが他リポジトリに展開可能か確認:

**確認項目:**

1. `templates/workflows/` 内のテンプレートが self-contained か(外部依存なし)
2. `.github/workflows/templates/` の再利用可能ワークフローが正しく定義されているか
3. `templates/github/` のテンプレート(CODEOWNERS, CONTRIBUTING.md 等)が最新か

**確認ロジック:**

```bash
# 再利用可能ワークフローの定義チェック
for f in .github/workflows/templates/*.yml; do
if ! grep -q 'workflow_call:' "$f" 2>/dev/null; then
echo "WARN: $(basename $f) is not a reusable workflow (missing workflow_call trigger)"
fi
done

# テンプレート内のハードコードされたリポジトリ名チェック
grep -rn 'keito4/config' templates/ | grep -v 'README\|\.md' || echo "OK: no hardcoded repo names"
```

**結果:**

- ✅ テンプレート展開準備完了
- ⚠️ 修正が必要なテンプレートあり

このチェックは情報提供のみで、自動修正は行わない。

### 3.6 GitHub Actions Cost Optimization Check

GitHub Actions のコスト最適化のため、全ワークフローの設定を確認:
Expand Down Expand Up @@ -2254,6 +2372,8 @@ fi
├── Pre-PR Checklist: ✅ CI workflow exists
├── CLAUDE.md: ✅ Symlink to AGENTS.md
├── CI/CD: ✅ Standard level configured
├── CI Template Sync: ✅ All templates match (or ⚠️ N files diverged)
├── CI Consistency: ✅ Node.js/Actions versions consistent (or ⚠️ mismatches found)
├── Actions Cost: ✅ Optimized (or ⚠️ X issues found)
│ ├── Artifact Retention: ✅ (or ⚠️ 90-day default detected)
│ ├── Unused Workflows: ✅ (or ⚠️ X stale workflows)
Expand Down Expand Up @@ -2484,40 +2604,43 @@ Run this command regularly to maintain repository health:

このコマンドは以下のコマンドを内部的に呼び出します:

| カテゴリ | コマンド | 説明 |
| ----------- | ------------------------------- | ----------------------------- |
| Environment | `/container-health` | コンテナ健全性 |
| Environment | `/config-base-sync-check` | DevContainer バージョン |
| Environment | `/config-base-sync-update` | DevContainer 更新 |
| Environment | `/update-claude-code` | Claude Code 更新 |
| Environment | `/update-actions` | GitHub Actions バージョン更新 |
| Environment | `/sync-claude-settings` | Claude 設定同期 |
| Environment | (Claude Code LSP setup) | LSP 設定 |
| Environment | `/codespaces-secrets` | Codespaces シークレット同期 |
| Environment | (Actions Security Hardening) | Actions SHA固定・権限・制限 |
| Setup | `/setup-team-protection` | GitHub保護ルール設定 |
| Setup | `/setup-husky` | Git hooks設定 |
| Setup | (check-file-length auto-setup) | ファイル行数チェック追加 |
| Setup | `/pre-pr-checklist` | PR前チェックリスト |
| Setup | (CLAUDE.md symlink check) | CLAUDE.md シンボリックリンク |
| Setup | `/setup-ci` | CI/CDワークフロー設定 |
| Setup | (Actions Cost Optimization) | GitHub Actions コスト最適化 |
| Setup | (Renovate/Dependabot check) | 依存関係自動更新設定 |
| Setup | (commitlint check) | コミットメッセージ品質管理 |
| Setup | (editorconfig check) | エディタスタイル設定 |
| Setup | (Dependabot Auto-merge check) | Dependabot 自動マージ設定 |
| Setup | (Label Sync check) | ラベル IaC 管理設定 |
| Setup | (pre-commit config check) | pre-commit フレームワーク設定 |
| Setup | (PR Template check) | PR テンプレート設定 |
| Setup | (Issue Template check) | Issue テンプレート設定 |
| Setup | (CODEOWNERS check) | コードオーナー設定 |
| Setup | (SECURITY.md check) | セキュリティポリシー設定 |
| Setup | (scripts standard check) | package.json scripts 標準確認 |
| Setup | (Push Protection check) | Secret scanning push 防止 |
| Setup | (Dependency Review check) | PR 依存関係脆弱性チェック |
| Setup | (Deploy Env Protection check) | デプロイ環境保護ルール |
| Cleanup | `/branch-cleanup` | ブランチクリーンアップ |
| Discovery | `/config-contribution-discover` | 新機能発見 |
| Discovery | (Package Audit + ni support) | 推奨パッケージ監査 |
| Discovery | (Provenance / SBOM Audit) | ビルド出所証明・SBOM 監査 |
| PR | (post_pr_ci_watch.py hook) | PR作成後のCI自動監視 |
| カテゴリ | コマンド | 説明 |
| ----------- | ------------------------------- | ---------------------------------- |
| Environment | `/container-health` | コンテナ健全性 |
| Environment | `/config-base-sync-check` | DevContainer バージョン |
| Environment | `/config-base-sync-update` | DevContainer 更新 |
| Environment | `/update-claude-code` | Claude Code 更新 |
| Environment | `/update-actions` | GitHub Actions バージョン更新 |
| Environment | `/sync-claude-settings` | Claude 設定同期 |
| Environment | (Claude Code LSP setup) | LSP 設定 |
| Environment | `/codespaces-secrets` | Codespaces シークレット同期 |
| Environment | (Actions Security Hardening) | Actions SHA固定・権限・制限 |
| Setup | `/setup-team-protection` | GitHub保護ルール設定 |
| Setup | `/setup-husky` | Git hooks設定 |
| Setup | (check-file-length auto-setup) | ファイル行数チェック追加 |
| Setup | `/pre-pr-checklist` | PR前チェックリスト |
| Setup | (CLAUDE.md symlink check) | CLAUDE.md シンボリックリンク |
| Setup | `/setup-ci` | CI/CDワークフロー設定 |
| Setup | (CI Template Sync) | テンプレートと実ファイルの乖離検出 |
| Setup | (CI Consistency) | ワークフロー間の設定整合性検証 |
| Setup | (CI Template Deployment) | 他リポジトリ展開準備状況確認 |
| Setup | (Actions Cost Optimization) | GitHub Actions コスト最適化 |
| Setup | (Renovate/Dependabot check) | 依存関係自動更新設定 |
| Setup | (commitlint check) | コミットメッセージ品質管理 |
| Setup | (editorconfig check) | エディタスタイル設定 |
| Setup | (Dependabot Auto-merge check) | Dependabot 自動マージ設定 |
| Setup | (Label Sync check) | ラベル IaC 管理設定 |
| Setup | (pre-commit config check) | pre-commit フレームワーク設定 |
| Setup | (PR Template check) | PR テンプレート設定 |
| Setup | (Issue Template check) | Issue テンプレート設定 |
| Setup | (CODEOWNERS check) | コードオーナー設定 |
| Setup | (SECURITY.md check) | セキュリティポリシー設定 |
| Setup | (scripts standard check) | package.json scripts 標準確認 |
| Setup | (Push Protection check) | Secret scanning push 防止 |
| Setup | (Dependency Review check) | PR 依存関係脆弱性チェック |
| Setup | (Deploy Env Protection check) | デプロイ環境保護ルール |
| Cleanup | `/branch-cleanup` | ブランチクリーンアップ |
| Discovery | `/config-contribution-discover` | 新機能発見 |
| Discovery | (Package Audit + ni support) | 推奨パッケージ監査 |
| Discovery | (Provenance / SBOM Audit) | ビルド出所証明・SBOM 監査 |
| PR | (post_pr_ci_watch.py hook) | PR作成後のCI自動監視 |
55 changes: 55 additions & 0 deletions .github/workflows/quality-gate-fallback.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Quality Gate Fallback
#
# CI ワークフローが paths フィルタでスキップされた場合に
# Required Status Check "Quality Gate" を Pass で報告する。
# CI が実行された場合は ci.yml 側の Quality Gate が優先される。
#
name: CI

on:
pull_request:
branches: [main, master, pre-production, production]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-fallback
cancel-in-progress: true

jobs:
quality-gate:
name: Quality Gate
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Check if CI workflow ran
id: check
uses: actions/github-script@v8
with:
script: |
const { data: runs } = await github.rest.actions.listWorkflowRunsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
head_sha: context.sha,
per_page: 20,
});

const ciRun = runs.workflow_runs.find(
r => r.name === 'CI' && r.id !== context.runId
);

if (ciRun && ciRun.status !== 'completed') {
core.info(`CI workflow is running (${ciRun.html_url}), this fallback is not needed.`);
core.setOutput('ci_running', 'true');
} else if (ciRun && ciRun.conclusion === 'success') {
core.info(`CI workflow already succeeded (${ciRun.html_url}).`);
core.setOutput('ci_running', 'true');
} else {
core.info('CI workflow did not run for this commit. Providing fallback Quality Gate.');
core.setOutput('ci_running', 'false');
}

- name: Pass (CI skipped)
if: steps.check.outputs.ci_running == 'false'
run: echo "Quality Gate passed (CI skipped — no code changes detected)."
13 changes: 9 additions & 4 deletions templates/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,25 @@ concurrency:

jobs:
dependabot-auto:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
# Dependabot 以外の場合はスキップ(Pass で終了)
- name: Skip non-Dependabot PRs
if: github.actor != 'dependabot[bot]'
run: echo "Not a Dependabot PR — skipping auto-merge."

# 更新種別を取得(patch / minor / major)
- name: Fetch Dependabot metadata
if: github.actor == 'dependabot[bot]'
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

# patch: 自動 squash マージ(CI パス後)
- name: Auto-merge patch updates
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
if: github.actor == 'dependabot[bot]' && steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: |
gh pr merge "$PR_URL" --auto --squash
env:
Expand All @@ -47,7 +52,7 @@ jobs:

# minor: 自動承認(マージは手動で判断)
- name: Auto-approve minor updates
if: steps.metadata.outputs.update-type == 'version-update:semver-minor'
if: github.actor == 'dependabot[bot]' && steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: |
gh pr review "$PR_URL" --approve --body "Auto-approved: minor version update"
env:
Expand All @@ -56,7 +61,7 @@ jobs:

# major: ラベル付与してレビュー必須
- name: Label major updates for review
if: steps.metadata.outputs.update-type == 'version-update:semver-major'
if: github.actor == 'dependabot[bot]' && steps.metadata.outputs.update-type == 'version-update:semver-major'
run: |
gh pr edit "$PR_URL" --add-label "needs-review,breaking-change"
env:
Expand Down
2 changes: 1 addition & 1 deletion templates/workflows/label-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Sync labels
uses: EndBug/label-sync@v2
Expand Down
Loading