From 7d4ceb4cb541de4b75ec68d51d0e20cacf0749d7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 16 Feb 2026 17:08:40 +0900 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=E4=B8=80=E6=8B=AC=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89=20`npm=20run=20up?= =?UTF-8?q?date:all`=20=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit npm/Claude Code/GitHub Actions の3種の依存関係更新を一括実行できる `update:all` コマンドと、GitHub Actions バージョン自動更新用の `update:actions` コマンドを追加。--skip-* オプションで個別スキップ可能。 Co-Authored-By: Claude Opus 4.6 --- package.json | 2 + script/update-actions.sh | 210 +++++++++++++++++++++++++++ script/update-all.sh | 132 +++++++++++++++++ test/integration/update_actions.bats | 144 ++++++++++++++++++ test/integration/update_all.bats | 107 ++++++++++++++ 5 files changed, 595 insertions(+) create mode 100755 script/update-actions.sh create mode 100755 script/update-all.sh create mode 100644 test/integration/update_actions.bats create mode 100644 test/integration/update_all.bats diff --git a/package.json b/package.json index 3181eb8f..1243afc5 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,8 @@ "test:coverage": "jest --runInBand --coverage", "update:libs": "bash script/update-libraries.sh", "update:claude": "bash script/update-claude-code.sh", + "update:actions": "bash script/update-actions.sh", + "update:all": "bash script/update-all.sh", "prepare": "husky" }, "devDependencies": { diff --git a/script/update-actions.sh b/script/update-actions.sh new file mode 100755 index 00000000..d9133a51 --- /dev/null +++ b/script/update-actions.sh @@ -0,0 +1,210 @@ +#!/usr/bin/env bash +# ============================================================================ +# GitHub Actions Version Update Script +# .github/workflows/ 配下のアクションを最新バージョンに更新します +# ============================================================================ + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PROJECT_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +WORKFLOWS_DIR="${PROJECT_ROOT}/.github/workflows" + +# カラー出力 +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +log_info() { echo -e "${BLUE}[INFO]${NC} $1"; } +log_success() { echo -e "${GREEN}[SUCCESS]${NC} $1"; } +log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; } +log_error() { echo -e "${RED}[ERROR]${NC} $1"; } + +# 必須コマンドチェック +if ! command -v gh >/dev/null 2>&1; then + log_error "gh (GitHub CLI) is required to update actions" + exit 1 +fi + +log_info "GitHub Actions バージョン更新を開始します..." + +# sed メタ文字エスケープ +escape_sed() { + printf '%s' "$1" | sed 's/[.[\/*^$]/\\&/g' +} + +# SemVer タグかどうか判定(v prefix 有無両対応) +is_semver_tag() { + local ref="$1" + [[ "$ref" =~ ^v?[0-9]+\.[0-9]+(\.[0-9]+)?$ ]] +} + +# SHA ピンニングかどうか判定(40文字hex) +is_sha_pin() { + local ref="$1" + [[ "$ref" =~ ^[0-9a-f]{40}$ ]] +} + +# 最新タグを取得 +get_latest_tag() { + local owner_repo="$1" + local tag + + # まず releases/latest を試行 + tag=$(gh api "repos/${owner_repo}/releases/latest" --jq '.tag_name' 2>/dev/null) || true + + if [[ -n "$tag" ]]; then + echo "$tag" + return 0 + fi + + # フォールバック: 最新タグを取得 + tag=$(gh api "repos/${owner_repo}/tags?per_page=1" --jq '.[0].name' 2>/dev/null) || true + + if [[ -n "$tag" ]]; then + echo "$tag" + return 0 + fi + + return 1 +} + +# v prefix の調整 +normalize_tag() { + local current_ref="$1" + local latest_tag="$2" + + if [[ "$current_ref" == v* ]]; then + # 現在のタグが v 付き → v 付きで返す + if [[ "$latest_tag" == v* ]]; then + echo "$latest_tag" + else + echo "v${latest_tag}" + fi + else + # 現在のタグが v なし → v を除去 + echo "${latest_tag#v}" + fi +} + +# ワークフローファイルを収集 +workflow_files=() +while IFS= read -r -d '' file; do + workflow_files+=("$file") +done < <(find "${WORKFLOWS_DIR}" -name '*.yml' -o -name '*.yaml' | tr '\n' '\0') + +if [[ ${#workflow_files[@]} -eq 0 ]]; then + log_warn "ワークフローファイルが見つかりません" + exit 0 +fi + +log_info "${#workflow_files[@]} 個のワークフローファイルを検出" + +# 重複排除のため処理済みアクションを記録 +declare -A processed_actions +declare -a updated_actions=() +declare -a skipped_actions=() + +for workflow_file in "${workflow_files[@]}"; do + # uses: 行を抽出 + while IFS= read -r line; do + # action@ref を抽出 + if [[ "$line" =~ uses:[[:space:]]*([^@]+)@([^[:space:]#]+) ]]; then + full_action="${BASH_REMATCH[1]}" + current_ref="${BASH_REMATCH[2]}" + + # 先頭/末尾の空白を除去 + full_action=$(echo "$full_action" | xargs) + + # ローカルアクション (./) や docker:// はスキップ + if [[ "$full_action" == ./* ]] || [[ "$full_action" == docker://* ]]; then + continue + fi + + # SHA ピンニングはスキップ + if is_sha_pin "$current_ref"; then + continue + fi + + # メジャータグ固定(v1, v3 など数字のみ)はスキップ + if [[ "$current_ref" =~ ^v?[0-9]+$ ]]; then + continue + fi + + # ブランチ固定(master, main など)はスキップ + if [[ "$current_ref" == "master" ]] || [[ "$current_ref" == "main" ]]; then + continue + fi + + # SemVer タグのみ更新対象 + if ! is_semver_tag "$current_ref"; then + continue + fi + + # owner/repo を抽出(サブパス対応: org/repo/path → org/repo) + local_owner_repo="${full_action}" + # スラッシュが2つ以上ある場合、最初の2パートのみ取得 + slash_count=$(echo "$full_action" | tr -cd '/' | wc -c | tr -d ' ') + if [[ "$slash_count" -ge 2 ]]; then + local_owner_repo=$(echo "$full_action" | cut -d'/' -f1-2) + fi + + # 処理済みチェック(同一アクション+同一バージョンは1回のみ) + action_key="${full_action}@${current_ref}" + if [[ -n "${processed_actions[$action_key]+x}" ]]; then + continue + fi + processed_actions[$action_key]=1 + + # 最新タグ取得 + latest_tag=$(get_latest_tag "$local_owner_repo") || true + if [[ -z "$latest_tag" ]]; then + log_warn "[SKIP] ${full_action}: リリース情報取得失敗" + skipped_actions+=("${full_action}@${current_ref}") + continue + fi + + # v prefix 調整 + new_ref=$(normalize_tag "$current_ref" "$latest_tag") + + # 既に最新ならスキップ + if [[ "$current_ref" == "$new_ref" ]]; then + continue + fi + + log_info "${full_action}: ${current_ref} -> ${new_ref}" + + # 全ワークフローファイルで置換 + escaped_action=$(escape_sed "$full_action") + for wf in "${workflow_files[@]}"; do + sed -i '' "s|\(uses:.*\)${escaped_action}@${current_ref}|\1${escaped_action}@${new_ref}|g" "$wf" + done + + updated_actions+=("${full_action}: ${current_ref} -> ${new_ref}") + fi + done < <(grep 'uses:' "$workflow_file" || true) +done + +# 変更サマリ表示 +echo "" +if [[ ${#updated_actions[@]} -gt 0 ]]; then + log_success "更新されたアクション:" + for update in "${updated_actions[@]}"; do + echo " - $update" + done +else + log_success "全てのアクションは最新です" +fi + +if [[ ${#skipped_actions[@]} -gt 0 ]]; then + echo "" + log_warn "スキップされたアクション:" + for skip in "${skipped_actions[@]}"; do + echo " - $skip" + done +fi + +echo "" +log_success "GitHub Actions バージョン更新完了!" diff --git a/script/update-all.sh b/script/update-all.sh new file mode 100755 index 00000000..0883bbbe --- /dev/null +++ b/script/update-all.sh @@ -0,0 +1,132 @@ +#!/usr/bin/env bash +# ============================================================================ +# Unified Update Orchestrator +# 全依存関係(npm, Claude Code, GitHub Actions)を一括更新します +# ============================================================================ + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +# カラー出力 +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +log_info() { echo -e "${BLUE}[INFO]${NC} $1"; } +log_success() { echo -e "${GREEN}[SUCCESS]${NC} $1"; } +log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; } +log_error() { echo -e "${RED}[ERROR]${NC} $1"; } + +# オプション解析 +skip_libs=false +skip_claude=false +skip_actions=false + +for arg in "$@"; do + case "$arg" in + --skip-libs) skip_libs=true ;; + --skip-claude) skip_claude=true ;; + --skip-actions) skip_actions=true ;; + --help|-h) + echo "Usage: $(basename "$0") [OPTIONS]" + echo "" + echo "Options:" + echo " --skip-libs update:libs をスキップ" + echo " --skip-claude update:claude をスキップ" + echo " --skip-actions update:actions をスキップ" + echo " --help, -h ヘルプを表示" + exit 0 + ;; + *) + log_error "不明なオプション: $arg" + exit 1 + ;; + esac +done + +log_info "一括更新を開始します..." +echo "" + +# 各ステップの結果を記録 +declare -A step_results + +# Step 1: npm 依存関係 + グローバルツール +if [[ "$skip_libs" == "true" ]]; then + log_warn "[SKIP] update:libs (--skip-libs)" + step_results[libs]="skipped" +else + log_info "===== Step 1/3: npm 依存関係更新 =====" + set +e + bash "${SCRIPT_DIR}/update-libraries.sh" + libs_exit=$? + set -e + if [[ $libs_exit -eq 0 ]]; then + step_results[libs]="success" + else + step_results[libs]="failed" + log_error "update:libs が失敗しました (exit code: ${libs_exit})" + fi + echo "" +fi + +# Step 2: Claude Code (Dockerfile) +if [[ "$skip_claude" == "true" ]]; then + log_warn "[SKIP] update:claude (--skip-claude)" + step_results[claude]="skipped" +else + log_info "===== Step 2/3: Claude Code 更新 =====" + set +e + bash "${SCRIPT_DIR}/update-claude-code.sh" + claude_exit=$? + set -e + if [[ $claude_exit -eq 0 ]]; then + step_results[claude]="success" + else + step_results[claude]="failed" + log_error "update:claude が失敗しました (exit code: ${claude_exit})" + fi + echo "" +fi + +# Step 3: GitHub Actions バージョン +if [[ "$skip_actions" == "true" ]]; then + log_warn "[SKIP] update:actions (--skip-actions)" + step_results[actions]="skipped" +else + log_info "===== Step 3/3: GitHub Actions 更新 =====" + set +e + bash "${SCRIPT_DIR}/update-actions.sh" + actions_exit=$? + set -e + if [[ $actions_exit -eq 0 ]]; then + step_results[actions]="success" + else + step_results[actions]="failed" + log_error "update:actions が失敗しました (exit code: ${actions_exit})" + fi + echo "" +fi + +# 最終サマリ +echo "============================================" +log_info "更新サマリ:" +has_failure=false +for step in libs claude actions; do + result="${step_results[$step]}" + case "$result" in + success) echo -e " ${GREEN}[OK]${NC} ${step}" ;; + failed) echo -e " ${RED}[FAIL]${NC} ${step}"; has_failure=true ;; + skipped) echo -e " ${YELLOW}[SKIP]${NC} ${step}" ;; + esac +done +echo "============================================" + +if [[ "$has_failure" == "true" ]]; then + log_error "一部のステップが失敗しました" + exit 1 +fi + +log_success "全ての更新が完了しました!" diff --git a/test/integration/update_actions.bats b/test/integration/update_actions.bats new file mode 100644 index 00000000..dd981aa9 --- /dev/null +++ b/test/integration/update_actions.bats @@ -0,0 +1,144 @@ +#!/usr/bin/env bats + +# Integration tests for update-actions.sh script + +load ../test_helper/test_helper + +@test "update-actions.sh script exists and is executable" { + local script="${REPO_ROOT}/script/update-actions.sh" + assert_file_exists "$script" + [ -x "$script" ] +} + +@test "update-actions.sh has proper error handling with set -euo pipefail" { + grep -q "set -euo pipefail" "${REPO_ROOT}/script/update-actions.sh" +} + +@test "update-actions.sh requires gh command" { + grep -q 'command -v gh' "${REPO_ROOT}/script/update-actions.sh" + grep -q 'gh (GitHub CLI) is required' "${REPO_ROOT}/script/update-actions.sh" +} + +@test "update-actions.sh scans .github/workflows directory" { + grep -q 'WORKFLOWS_DIR.*\.github/workflows' "${REPO_ROOT}/script/update-actions.sh" + grep -q "find.*WORKFLOWS_DIR.*\.yml.*\.yaml" "${REPO_ROOT}/script/update-actions.sh" +} + +@test "update-actions.sh skips SHA pinned actions" { + local test_script="${TEST_TEMP_DIR}/test-sha-skip.sh" + cat > "$test_script" << 'SCRIPT' +#!/usr/bin/env bash +is_sha_pin() { + local ref="$1" + [[ "$ref" =~ ^[0-9a-f]{40}$ ]] +} +# 40-char hex should match +if is_sha_pin "e58ee9d111489c31395fbe4857b0be6e7635dbda"; then + echo "SHA detected" +else + echo "SHA not detected" +fi +# Short hash should not match +if is_sha_pin "abc123"; then + echo "Short hash detected" +else + echo "Short hash skipped" +fi +SCRIPT + chmod +x "$test_script" + + run "$test_script" + assert_success + [[ "$output" == *"SHA detected"* ]] + [[ "$output" == *"Short hash skipped"* ]] +} + +@test "update-actions.sh skips major-only tags" { + local test_script="${TEST_TEMP_DIR}/test-major-skip.sh" + cat > "$test_script" << 'SCRIPT' +#!/usr/bin/env bash +is_semver_tag() { + local ref="$1" + [[ "$ref" =~ ^v?[0-9]+\.[0-9]+(\.[0-9]+)?$ ]] +} +# Major-only tags should not match semver +for tag in "v1" "v3" "v6"; do + if is_semver_tag "$tag"; then + echo "$tag: semver" + else + echo "$tag: skipped" + fi +done +# SemVer tags should match +for tag in "v6.0.2" "v0.34.0" "5.5.2"; do + if is_semver_tag "$tag"; then + echo "$tag: semver" + else + echo "$tag: skipped" + fi +done +SCRIPT + chmod +x "$test_script" + + run "$test_script" + assert_success + [[ "$output" == *"v1: skipped"* ]] + [[ "$output" == *"v3: skipped"* ]] + [[ "$output" == *"v6: skipped"* ]] + [[ "$output" == *"v6.0.2: semver"* ]] + [[ "$output" == *"v0.34.0: semver"* ]] + [[ "$output" == *"5.5.2: semver"* ]] +} + +@test "update-actions.sh skips local and docker actions" { + grep -q '\./' "${REPO_ROOT}/script/update-actions.sh" + grep -q 'docker://' "${REPO_ROOT}/script/update-actions.sh" +} + +@test "update-actions.sh skips branch-pinned actions" { + grep -q '"master"' "${REPO_ROOT}/script/update-actions.sh" + grep -q '"main"' "${REPO_ROOT}/script/update-actions.sh" +} + +@test "update-actions.sh has v-prefix normalization logic" { + local test_script="${TEST_TEMP_DIR}/test-normalize.sh" + cat > "$test_script" << 'SCRIPT' +#!/usr/bin/env bash +normalize_tag() { + local current_ref="$1" + local latest_tag="$2" + if [[ "$current_ref" == v* ]]; then + if [[ "$latest_tag" == v* ]]; then + echo "$latest_tag" + else + echo "v${latest_tag}" + fi + else + echo "${latest_tag#v}" + fi +} +# v-prefix current + v-prefix latest +echo "$(normalize_tag "v6.0.2" "v6.1.0")" +# v-prefix current + no-prefix latest +echo "$(normalize_tag "v6.0.2" "6.1.0")" +# no-prefix current + v-prefix latest +echo "$(normalize_tag "6.0.2" "v6.1.0")" +SCRIPT + chmod +x "$test_script" + + run "$test_script" + assert_success + [[ "${lines[0]}" == "v6.1.0" ]] + [[ "${lines[1]}" == "v6.1.0" ]] + [[ "${lines[2]}" == "6.1.0" ]] +} + +@test "update-actions.sh uses gh api for release lookup" { + grep -q 'gh api "repos/.*releases/latest"' "${REPO_ROOT}/script/update-actions.sh" + grep -q 'gh api "repos/.*tags?per_page=1"' "${REPO_ROOT}/script/update-actions.sh" +} + +@test "update-actions.sh has sed escape function" { + grep -q 'escape_sed' "${REPO_ROOT}/script/update-actions.sh" + grep -q "sed 's/\[" "${REPO_ROOT}/script/update-actions.sh" +} diff --git a/test/integration/update_all.bats b/test/integration/update_all.bats new file mode 100644 index 00000000..e938fce6 --- /dev/null +++ b/test/integration/update_all.bats @@ -0,0 +1,107 @@ +#!/usr/bin/env bats + +# Integration tests for update-all.sh script + +load ../test_helper/test_helper + +@test "update-all.sh script exists and is executable" { + local script="${REPO_ROOT}/script/update-all.sh" + assert_file_exists "$script" + [ -x "$script" ] +} + +@test "update-all.sh has proper error handling with set -euo pipefail" { + grep -q "set -euo pipefail" "${REPO_ROOT}/script/update-all.sh" +} + +@test "update-all.sh invokes all three update scripts" { + grep -q 'update-libraries.sh' "${REPO_ROOT}/script/update-all.sh" + grep -q 'update-claude-code.sh' "${REPO_ROOT}/script/update-all.sh" + grep -q 'update-actions.sh' "${REPO_ROOT}/script/update-all.sh" +} + +@test "update-all.sh supports --skip-libs option" { + grep -q '\-\-skip-libs' "${REPO_ROOT}/script/update-all.sh" + + local test_script="${TEST_TEMP_DIR}/test-skip-libs.sh" + cat > "$test_script" << 'SCRIPT' +#!/usr/bin/env bash +skip_libs=false +for arg in "$@"; do + case "$arg" in + --skip-libs) skip_libs=true ;; + esac +done +echo "skip_libs=$skip_libs" +SCRIPT + chmod +x "$test_script" + + run "$test_script" --skip-libs + assert_success + [[ "$output" == "skip_libs=true" ]] +} + +@test "update-all.sh supports --skip-claude option" { + grep -q '\-\-skip-claude' "${REPO_ROOT}/script/update-all.sh" + + local test_script="${TEST_TEMP_DIR}/test-skip-claude.sh" + cat > "$test_script" << 'SCRIPT' +#!/usr/bin/env bash +skip_claude=false +for arg in "$@"; do + case "$arg" in + --skip-claude) skip_claude=true ;; + esac +done +echo "skip_claude=$skip_claude" +SCRIPT + chmod +x "$test_script" + + run "$test_script" --skip-claude + assert_success + [[ "$output" == "skip_claude=true" ]] +} + +@test "update-all.sh supports --skip-actions option" { + grep -q '\-\-skip-actions' "${REPO_ROOT}/script/update-all.sh" + + local test_script="${TEST_TEMP_DIR}/test-skip-actions.sh" + cat > "$test_script" << 'SCRIPT' +#!/usr/bin/env bash +skip_actions=false +for arg in "$@"; do + case "$arg" in + --skip-actions) skip_actions=true ;; + esac +done +echo "skip_actions=$skip_actions" +SCRIPT + chmod +x "$test_script" + + run "$test_script" --skip-actions + assert_success + [[ "$output" == "skip_actions=true" ]] +} + +@test "update-all.sh supports --help option" { + grep -q '\-\-help' "${REPO_ROOT}/script/update-all.sh" + grep -q 'Usage:' "${REPO_ROOT}/script/update-all.sh" +} + +@test "update-all.sh rejects unknown options" { + grep -q '不明なオプション' "${REPO_ROOT}/script/update-all.sh" +} + +@test "update-all.sh records step results and shows summary" { + grep -q 'step_results' "${REPO_ROOT}/script/update-all.sh" + grep -q '更新サマリ' "${REPO_ROOT}/script/update-all.sh" +} + +@test "update-all.sh exits with 1 if any step fails" { + grep -q 'has_failure.*true' "${REPO_ROOT}/script/update-all.sh" + grep -q 'exit 1' "${REPO_ROOT}/script/update-all.sh" +} + +@test "update-all.sh runs steps independently with set +e" { + grep -q 'set +e' "${REPO_ROOT}/script/update-all.sh" +} From acf935f33d26f7807eb75eeaa6b4cd434e3e9b90 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 16 Feb 2026 17:14:02 +0900 Subject: [PATCH 2/4] =?UTF-8?q?docs:=20/update-actions=20=E3=82=B3?= =?UTF-8?q?=E3=83=9E=E3=83=B3=E3=83=89=E8=BF=BD=E5=8A=A0=E3=81=A8=E9=96=A2?= =?UTF-8?q?=E9=80=A3=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .claude/commands/update-actions.md を新規作成 - README.md の Quick Reference と Scripts テーブルに追加 - repo-maintenance.md に GitHub Actions 更新ステップ (2.5) を追加 Co-Authored-By: Claude Opus 4.6 --- .claude/commands/README.md | 22 ++++++++++ .claude/commands/repo-maintenance.md | 60 +++++++++++++++++++--------- .claude/commands/update-actions.md | 54 +++++++++++++++++++++++++ 3 files changed, 118 insertions(+), 18 deletions(-) create mode 100644 .claude/commands/update-actions.md diff --git a/.claude/commands/README.md b/.claude/commands/README.md index dcaf977b..9016ed80 100644 --- a/.claude/commands/README.md +++ b/.claude/commands/README.md @@ -29,6 +29,7 @@ This directory contains pre-configured commands that provide automated workflows | **Config Sync** | `/sync-settings` | Claude/Codex 設定の同期 | | | `/config-contribution-discover` | 新機能の発見と取り込み | | **Updates** | `/update-claude-code` | Claude Code の更新 | +| | `/update-actions` | GitHub Actions バージョンの更新 | | **Documentation** | `/changelog-generator` | Conventional Commits から CHANGELOG を生成 | ## Available Commands @@ -318,6 +319,25 @@ This directory contains pre-configured commands that provide automated workflows /update-claude-code ``` +#### `update-actions.md` + +**Purpose**: Update GitHub Actions to the latest versions +**Features**: + +- `.github/workflows/` 配下の全ワークフローファイルをスキャン +- SemVer タグのアクションを最新バージョンに更新 +- メジャータグ固定・SHA ピンニング・ブランチ固定はスキップ +- `npm run update:all` で全依存関係の一括更新も可能 + +**Usage**: + +``` +/update-actions +npm run update:actions +npm run update:all # 全依存関係の一括更新 +npm run update:all -- --skip-libs --skip-claude # Actions のみ +``` + #### `setup-new-repo.md` **Purpose**: Setup new repository with DevContainer, CI/CD, and development tools from config template @@ -500,6 +520,8 @@ This directory contains pre-configured commands that provide automated workflows | `setup-team-protection.sh` | `/setup-team-protection` | GitHub 保護ルールの設定 | | `test-coverage-trend.sh` | `/test-coverage-trend` | テストカバレッジのトレンド追跡 | | `update-claude-code.sh` | `/update-claude-code` | Claude Code の更新 | +| `update-actions.sh` | `/update-actions` | GitHub Actions バージョンの更新 | +| `update-all.sh` | npm scripts | 全依存関係の一括更新 | ### DevContainer・インフラ用スクリプト(コマンド経由では使用しない) diff --git a/.claude/commands/repo-maintenance.md b/.claude/commands/repo-maintenance.md index 54a81ddf..740c6cf0 100644 --- a/.claude/commands/repo-maintenance.md +++ b/.claude/commands/repo-maintenance.md @@ -117,13 +117,35 @@ npm view @anthropic-ai/claude-code version MODE が `full` の場合は `/update-claude-code` コマンドを実行。 -### 2.5 Claude Settings Sync Check (full mode only) +### 2.5 GitHub Actions Version Check + +GitHub Actions のバージョンを確認・更新: + +```bash +npm run update:actions +``` + +または一括更新(npm + Claude Code + Actions): + +```bash +npm run update:all +npm run update:all -- --skip-libs --skip-claude # Actions のみ +``` + +結果: + +- ✅ 全アクション最新 +- ⚠️ 更新可能なアクションあり + +MODE が `full` の場合は `/update-actions` コマンドを実行。 + +### 2.6 Claude Settings Sync Check (full mode only) このリポジトリが config リポジトリの場合のみ実行: `/sync-claude-settings` の実行を確認。 -### 2.6 Claude Code LSP Setup Check +### 2.7 Claude Code LSP Setup Check Claude Code の LSP(Language Server Protocol)サポートの設定状況を確認: @@ -210,7 +232,7 @@ ENABLE_LSP_TOOL=1 npx @anthropic-ai/claude-code@stable - [Claude Code LSP 設定ガイド](https://blog.lai.so/claude-code-lsp/) - [公式プラグイン](https://github.com/anthropics/claude-plugins-official) -### 2.7 Codespaces Secrets Sync Check +### 2.8 Codespaces Secrets Sync Check GitHub Codespaces を使用する場合のシークレット紐付け状況を確認: @@ -392,6 +414,7 @@ config リポジトリから取り込み可能な新機能を発見: ├── Container Health: ✅ Healthy (Score: 95/100) ├── DevContainer: ⚠️ Update available (v1.13.1 → v1.15.0) ├── Claude Code: ✅ Up to date +├── GitHub Actions: ✅ All actions up to date ├── Claude Settings: ✅ Synced ├── Claude Code LSP: ⚠️ Not configured (TypeScript detected) └── Codespaces Secrets: ✅ Synced (or ⏭️ Skipped) @@ -573,18 +596,19 @@ 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 | `/sync-claude-settings` | Claude 設定同期 | -| Environment | (Claude Code LSP setup) | LSP 設定 | -| Environment | `/codespaces-secrets` | Codespaces シークレット同期 | -| Setup | `/setup-team-protection` | GitHub保護ルール設定 | -| Setup | `/setup-husky` | Git hooks設定 | -| Setup | `/pre-pr-checklist` | PR前チェックリスト | -| Setup | `/setup-ci` | CI/CDワークフロー設定 | -| Cleanup | `/branch-cleanup` | ブランチクリーンアップ | -| Discovery | `/config-contribution-discover` | 新機能発見 | +| カテゴリ | コマンド | 説明 | +| ----------- | ------------------------------- | ----------------------------- | +| 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 シークレット同期 | +| Setup | `/setup-team-protection` | GitHub保護ルール設定 | +| Setup | `/setup-husky` | Git hooks設定 | +| Setup | `/pre-pr-checklist` | PR前チェックリスト | +| Setup | `/setup-ci` | CI/CDワークフロー設定 | +| Cleanup | `/branch-cleanup` | ブランチクリーンアップ | +| Discovery | `/config-contribution-discover` | 新機能発見 | diff --git a/.claude/commands/update-actions.md b/.claude/commands/update-actions.md new file mode 100644 index 00000000..3ac56772 --- /dev/null +++ b/.claude/commands/update-actions.md @@ -0,0 +1,54 @@ +# Update GitHub Actions + +GitHub Actions のバージョンを最新に自動更新します。 + +## 実行内容 + +1. `.github/workflows/` 配下の全ワークフローファイル(テンプレート含む)をスキャン +2. `uses:` 行から action/ref ペアを抽出 +3. SemVer タグのアクションのみ更新対象(メジャータグ固定・SHA ピンニング・ブランチ固定はスキップ) +4. `gh api` で最新リリースタグを取得 +5. `sed` で一括置換 +6. 変更サマリを表示 + +## 使用方法 + +```bash +/update-actions +``` + +または npm script として: + +```bash +npm run update:actions +``` + +## 更新対象の判定 + +| パターン | 例 | 対応 | +| ------------------ | -------------------------- | -------- | +| SemVer タグ | `@v6.0.2`, `@0.34.0` | 更新対象 | +| メジャータグ固定 | `@v1`, `@v3` | スキップ | +| ブランチ固定 | `@master`, `@main` | スキップ | +| SHA ピンニング | `@e58ee9d1...` (40文字hex) | スキップ | +| ローカルアクション | `./` | スキップ | +| Docker アクション | `docker://` | スキップ | + +## 必須コマンド + +- `gh` (GitHub CLI) — リリース/タグ情報の取得に使用 + +## 一括更新 + +全依存関係(npm + Claude Code + Actions)を一括更新する場合: + +```bash +npm run update:all +npm run update:all -- --skip-libs # Actions + Claude のみ +npm run update:all -- --skip-claude # Actions + libs のみ +npm run update:all -- --skip-actions # libs + Claude のみ +``` + +## 参考リンク + +- [GitHub Actions バージョニング](https://docs.github.com/en/actions/creating-actions/about-custom-actions#using-tags-for-release-management) From 9b3ae8bdf24521a9be844fd84b812675f3a03aa2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 16 Feb 2026 17:18:09 +0900 Subject: [PATCH 3/4] =?UTF-8?q?docs:=20README.md=20=E3=81=AE=20Updates=20?= =?UTF-8?q?=E3=82=BB=E3=82=AF=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92=E7=8B=AC?= =?UTF-8?q?=E7=AB=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit update-claude-code と update-actions を Development Environment から 独立した Updates セクションに移動し、update:all の使い方を追加。 Quick Reference テーブルのカテゴリ構造と整合性を確保。 Co-Authored-By: Claude Opus 4.6 --- .claude/commands/README.md | 79 ++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 34 deletions(-) diff --git a/.claude/commands/README.md b/.claude/commands/README.md index 9016ed80..1f57baf1 100644 --- a/.claude/commands/README.md +++ b/.claude/commands/README.md @@ -304,40 +304,6 @@ This directory contains pre-configured commands that provide automated workflows /config-base-sync-update --version 1.60.0 ``` -#### `update-claude-code.md` - -**Purpose**: Update Claude Code to the latest version -**Features**: - -- npm/global.json の Claude Code バージョン更新 -- 最新バージョンの自動検出 -- 更新 PR の作成 - -**Usage**: - -``` -/update-claude-code -``` - -#### `update-actions.md` - -**Purpose**: Update GitHub Actions to the latest versions -**Features**: - -- `.github/workflows/` 配下の全ワークフローファイルをスキャン -- SemVer タグのアクションを最新バージョンに更新 -- メジャータグ固定・SHA ピンニング・ブランチ固定はスキップ -- `npm run update:all` で全依存関係の一括更新も可能 - -**Usage**: - -``` -/update-actions -npm run update:actions -npm run update:all # 全依存関係の一括更新 -npm run update:all -- --skip-libs --skip-claude # Actions のみ -``` - #### `setup-new-repo.md` **Purpose**: Setup new repository with DevContainer, CI/CD, and development tools from config template @@ -503,6 +469,51 @@ npm run update:all -- --skip-libs --skip-claude # Actions のみ /security-review path/to/file.ts ``` +### Updates + +#### `update-claude-code.md` + +**Purpose**: Update Claude Code to the latest version +**Features**: + +- npm/global.json の Claude Code バージョン更新 +- Dockerfile のバージョン更新 +- 最新バージョンの自動検出 + +**Usage**: + +``` +/update-claude-code +``` + +#### `update-actions.md` + +**Purpose**: Update GitHub Actions to the latest versions +**Features**: + +- `.github/workflows/` 配下の全ワークフローファイルをスキャン +- SemVer タグのアクションを最新バージョンに更新 +- メジャータグ固定・SHA ピンニング・ブランチ固定はスキップ + +**Usage**: + +``` +/update-actions +npm run update:actions +``` + +#### 一括更新 (`npm run update:all`) + +全依存関係を一括更新するオーケストレーター: + +```bash +npm run update:all # 全更新 +npm run update:all -- --skip-libs # Claude + Actions のみ +npm run update:all -- --skip-claude # libs + Actions のみ +npm run update:all -- --skip-actions # libs + Claude のみ +npm run update:all -- --skip-libs --skip-claude # Actions のみ +``` + ## Scripts Used by Commands 以下のスクリプトがコマンドから呼び出されます。詳細は [script/README.md](../../script/README.md) を参照してください。 From e79f5cd4c5a13b46bec7dce6d7cd12624c3c91c8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 16 Feb 2026 17:21:18 +0900 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=81=AE=20GitHub=20Actions=20=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=92=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E3=81=AB=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - actions/setup-node: v6.1.0 → v6.2.0 - zaproxy/action-baseline: v0.14.0 → v0.15.0 Co-Authored-By: Claude Opus 4.6 --- .github/workflows/templates/monorepo-release.yml | 6 +++--- .github/workflows/templates/unified-ci.yml | 4 ++-- .github/workflows/templates/update-db-types.yml | 2 +- .github/workflows/templates/zap-baseline.yml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/templates/monorepo-release.yml b/.github/workflows/templates/monorepo-release.yml index 06616ea5..936724ea 100644 --- a/.github/workflows/templates/monorepo-release.yml +++ b/.github/workflows/templates/monorepo-release.yml @@ -100,7 +100,7 @@ jobs: persist-credentials: false - name: Setup Node.js - uses: actions/setup-node@v6.1.0 + uses: actions/setup-node@v6.2.0 with: node-version: '20' cache: 'npm' @@ -140,7 +140,7 @@ jobs: persist-credentials: false - name: Setup Node.js - uses: actions/setup-node@v6.1.0 + uses: actions/setup-node@v6.2.0 with: node-version: '20' cache: 'npm' @@ -180,7 +180,7 @@ jobs: persist-credentials: false - name: Setup Node.js - uses: actions/setup-node@v6.1.0 + uses: actions/setup-node@v6.2.0 with: node-version: '20' cache: 'npm' diff --git a/.github/workflows/templates/unified-ci.yml b/.github/workflows/templates/unified-ci.yml index cf72216b..505ae1e3 100644 --- a/.github/workflows/templates/unified-ci.yml +++ b/.github/workflows/templates/unified-ci.yml @@ -76,7 +76,7 @@ jobs: uses: actions/checkout@v6.0.2 - name: Setup Node.js - uses: actions/setup-node@v6.1.0 + uses: actions/setup-node@v6.2.0 with: node-version: '20' cache: 'npm' # or 'pnpm' if using pnpm @@ -111,7 +111,7 @@ jobs: uses: actions/checkout@v6.0.2 - name: Setup Node.js - uses: actions/setup-node@v6.1.0 + uses: actions/setup-node@v6.2.0 with: node-version: '20' cache: 'npm' diff --git a/.github/workflows/templates/update-db-types.yml b/.github/workflows/templates/update-db-types.yml index 17e6494e..39455ffe 100644 --- a/.github/workflows/templates/update-db-types.yml +++ b/.github/workflows/templates/update-db-types.yml @@ -41,7 +41,7 @@ jobs: - uses: actions/checkout@v6.0.2 - name: Setup Node.js - uses: actions/setup-node@v6.1.0 + uses: actions/setup-node@v6.2.0 with: node-version: '22' cache: 'npm' diff --git a/.github/workflows/templates/zap-baseline.yml b/.github/workflows/templates/zap-baseline.yml index 395630a4..12dc9552 100644 --- a/.github/workflows/templates/zap-baseline.yml +++ b/.github/workflows/templates/zap-baseline.yml @@ -81,7 +81,7 @@ jobs: fi - name: ZAP Baseline Scan - uses: zaproxy/action-baseline@v0.14.0 + uses: zaproxy/action-baseline@v0.15.0 with: target: ${{ steps.target.outputs.url }} rules_file_name: '.zap/rules.tsv'