Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 11 additions & 7 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,18 @@ RUN OP_VERSION="${OP_CLI_VERSION}" \
&& chmod g+s /usr/local/bin/op

# Install Node.js
RUN NODE_VERSION=v22.22.0 \
&& NODE_ARCH=$(dpkg --print-architecture | sed 's/amd64/x64/;s/armhf/armv7l/;s/arm64/arm64/') \
&& wget -q https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz \
&& tar -xJf node-${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz -C /usr/local --strip-components=1 \
&& rm node-${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz \
# Version is managed by .github/workflows/update-dev-tools.yml
ARG NODE_VERSION=22.22.0
RUN NODE_ARCH=$(dpkg --print-architecture | sed 's/amd64/x64/;s/armhf/armv7l/;s/arm64/arm64/') \
&& wget -q https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz \
&& tar -xJf node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz -C /usr/local --strip-components=1 \
&& rm node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs

RUN npm install -g pnpm@10.30.3
# Install pnpm
# Version is managed by .github/workflows/update-dev-tools.yml
ARG PNPM_VERSION=10.30.3
RUN npm install -g pnpm@${PNPM_VERSION}

USER vscode
ENV SHELL=/bin/bash
Expand All @@ -100,7 +104,7 @@ COPY npm/global.json /tmp/npm-global.json

# Install Claude Code using native installer (npm installation deprecated)
# Must run as vscode user so claude installs to /home/vscode/.claude/local/bin
# Version is managed by .github/workflows/update-claude-code.yml
# Version is managed by .github/workflows/update-dev-tools.yml
ARG CLAUDE_CODE_VERSION=2.1.71
USER vscode
RUN curl -fsSL https://claude.ai/install.sh | bash -s "${CLAUDE_CODE_VERSION}" \
Expand Down
87 changes: 0 additions & 87 deletions .github/workflows/update-claude-code.yml

This file was deleted.

101 changes: 101 additions & 0 deletions .github/workflows/update-claude-plugins.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Update Claude Plugins

on:
schedule:
# 毎週月曜日 UTC 6:00(JST 15:00)に実行
- cron: '0 6 * * 1'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

permissions:
contents: write
pull-requests: write

jobs:
check-updates:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '22'

- name: Install Claude Code
run: |
curl -fsSL https://claude.ai/install.sh | bash
echo "$HOME/.claude/local/bin" >> $GITHUB_PATH

- name: Check for plugin updates
id: check
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: |
# プラグインリストを読み込み
PLUGINS_FILE=".claude/plugins/plugins.txt"
UPDATES=""
HAS_UPDATES="false"

# プラグインごとに更新をチェック
while IFS= read -r line || [[ -n "$line" ]]; do
# コメントと空行をスキップ
[[ "$line" =~ ^#.*$ || -z "$line" ]] && continue

PLUGIN_NAME=$(echo "$line" | cut -d'@' -f1)
MARKETPLACE=$(echo "$line" | cut -d'@' -f2)

echo "Checking $PLUGIN_NAME from $MARKETPLACE..."

# claude plugin list で現在のバージョンを取得(認証なしでも動作する場合)
# 注: 実際のバージョンチェックは claude CLI の機能に依存

done < "$PLUGINS_FILE"

# マーケットプレイスの更新情報を取得
echo "Checking marketplace updates..."

# 更新があるかチェック(簡易版)
# 実際の実装では claude CLI または API を使用
echo "has_updates=false" >> $GITHUB_OUTPUT

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Drive has_updates from actual plugin checks

The check step always writes has_updates=false, while both update and PR steps are gated on steps.check.outputs.has_updates == 'true'; as a result, this workflow can never produce plugin update PRs even when plugins are outdated, so the weekly automation is effectively disabled.

Useful? React with 👍 / 👎.

echo "summary=Plugin update check completed. Manual review recommended." >> $GITHUB_OUTPUT

- name: Update plugins list
if: steps.check.outputs.has_updates == 'true'
run: |
echo "Updating plugins.txt with new versions..."
# 実装: 新しいバージョン情報でファイルを更新
Comment on lines +33 to +70

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

This workflow is effectively a no-op right now.

has_updates is hardcoded to false, and the only mutation step is still a placeholder. That means the PR path can never run today, and even after real detection is added there is no versioned artifact here to change because .claude/plugins/plugins.txt only stores plugin@marketplace entries. Consider either introducing a lock/manifest file that can actually be updated or switching this workflow to reporting-only instead of PR creation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/update-claude-plugins.yml around lines 33 - 70, The
workflow currently does no real detection and always emits has_updates=false, so
replace the placeholder logic in the "check" step (id: check) that reads
PLUGINS_FILE (.claude/plugins/plugins.txt) and sets has_updates with real
comparison logic: for each PLUGIN_NAME/MARKETPLACE pair parse the currently
installed version (via the claude CLI or API) and the marketplace latest,
collect changed entries into UPDATES, set HAS_UPDATES to true when any diff is
found and emit the proper has_updates and summary outputs; then either (a)
implement the "Update plugins list" step to update a versioned lock/manifest
file (e.g., plugins.lock or a versioned .claude/plugins/manifest.json) with
exact plugin@version entries so the workflow can create a PR, or (b) change the
workflow to reporting-only by writing a human-readable report artifact and not
attempting to create a PR—ensure the outputs referenced by if:
steps.check.outputs.has_updates and the file variables PLUGINS_FILE/UPDATES are
updated accordingly.


- name: Create pull request
if: steps.check.outputs.has_updates == 'true'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: fix/update-claude-plugins
delete-branch: true
commit-message: 'fix: update Claude plugins'
title: 'fix: update Claude plugins'
body: |
## Claude プラグインの更新

${{ steps.check.outputs.summary }}

### プラグイン一覧

```
$(cat .claude/plugins/plugins.txt | grep -v '^#' | grep -v '^$')
```

---

**Auto-generated by:** [update-claude-plugins.yml](.github/workflows/update-claude-plugins.yml)
labels: dependencies

- name: Summary
run: |
echo "ℹ️ Claude plugin update check completed"
echo "Current plugins:"
cat .claude/plugins/plugins.txt | grep -v '^#' | grep -v '^$' || true
170 changes: 170 additions & 0 deletions .github/workflows/update-dev-tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
name: Update Development Tools

on:
schedule:
# 毎日 UTC 5:00(JST 14:00)に実行
- cron: '0 5 * * *'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

permissions:
contents: write
pull-requests: write

jobs:
check-updates:
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
has_updates: ${{ steps.compare.outputs.has_updates }}
updates_summary: ${{ steps.compare.outputs.summary }}
steps:
Comment on lines +17 to +24

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

Gate the autogenerated PR behind validation jobs.

This workflow rewrites .devcontainer/Dockerfile and opens a PR immediately, but it never runs lint/test/build/security checks first. A bad upstream release will therefore create a broken update PR instead of failing in automation. As per coding guidelines, "Implement CI/CD pipeline using GitHub Actions with stages: Lint → Test → Build → SCA → Deploy".

Also applies to: 113-162

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/update-dev-tools.yml around lines 17 - 24, The workflow
currently creates update PRs directly from the check-updates job (outputs from
steps.compare) without running validations; add sequential validation jobs named
lint, test, build, and sca that run before the PR creation job and make the PR
job depend on them using needs (e.g., needs: [check-updates, lint, test, build,
sca]) and conditional execution so the PR step only runs when all prior jobs
succeed; ensure the compare step output (steps.compare.outputs.has_updates /
summary) is still passed through and that the PR creation step is skipped when
has_updates is false, and apply the same gating change for the similar block
referenced at 113-162.

- uses: actions/checkout@v4

- name: Get current versions from Dockerfile
id: current
run: |
echo "gh_cli=$(grep -oP 'GH_CLI_VERSION=\K[0-9.]+' .devcontainer/Dockerfile)" >> $GITHUB_OUTPUT
echo "doppler=$(grep -oP 'DOPPLER_CLI_VERSION=\K[0-9.]+' .devcontainer/Dockerfile)" >> $GITHUB_OUTPUT
echo "op_cli=$(grep -oP 'OP_CLI_VERSION=\K[0-9.]+' .devcontainer/Dockerfile)" >> $GITHUB_OUTPUT
echo "node=$(grep -oP 'NODE_VERSION=\K[0-9.]+' .devcontainer/Dockerfile)" >> $GITHUB_OUTPUT
echo "pnpm=$(grep -oP 'PNPM_VERSION=\K[0-9.]+' .devcontainer/Dockerfile)" >> $GITHUB_OUTPUT
echo "claude_code=$(grep -oP 'CLAUDE_CODE_VERSION=\K[0-9.]+' .devcontainer/Dockerfile)" >> $GITHUB_OUTPUT

- name: Get latest versions
id: latest
run: |
# GitHub CLI - GitHub Releases API
GH_LATEST=$(curl -s https://api.github.com/repos/cli/cli/releases/latest | jq -r '.tag_name' | sed 's/^v//')
echo "gh_cli=$GH_LATEST" >> $GITHUB_OUTPUT

# Doppler CLI - GitHub Releases API
DOPPLER_LATEST=$(curl -s https://api.github.com/repos/DopplerHQ/cli/releases/latest | jq -r '.tag_name' | sed 's/^v//')
echo "doppler=$DOPPLER_LATEST" >> $GITHUB_OUTPUT

# 1Password CLI - releases page
OP_LATEST=$(curl -s https://app-updates.agilebits.com/check/1/0/CLI2/en/0/N -H "User-Agent: Mozilla/5.0" | jq -r '.version // empty' || curl -s https://api.github.com/repos/1Password/connect/releases/latest | jq -r '.tag_name' | sed 's/^v//' || echo "")
if [ -z "$OP_LATEST" ]; then
# Fallback: use current version if can't fetch
OP_LATEST="${{ steps.current.outputs.op_cli }}"
fi
echo "op_cli=$OP_LATEST" >> $GITHUB_OUTPUT
Comment on lines +48 to +54

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

🌐 Web query:

Does the GitHub repository 1Password/connect publish releases for the same product as the 1Password CLI (op), or is it a separate product from the CLI feed at app-updates.agilebits.com/check/1/0/CLI2/en/0/N?

💡 Result:

1Password/connect is not the same product as the 1Password CLI (op). It’s the open-source repo for 1Password Connect Server (a self-hosted service that exposes a private REST API so your infrastructure/apps can access 1Password items). The repo’s README explicitly describes Connect in those terms and notes it can be used “using a private REST API or the 1Password CLI” (meaning the CLI can talk to Connect, not that it is Connect). [1], [2]

The update feed at app-updates.agilebits.com/check/1/0/CLI2/en/0/N corresponds to 1Password CLI 2 releases (the op client), which has its own release history/channel separate from Connect. [3], [4]

Conclusion: Connect is a separate product (Connect Server) from the CLI; it does not publish releases for the same artifact as the CLI update feed. [1], [3]

Sources:
[1] https://github.com/1Password/connect
[2] https://developer.1password.com/docs/connect/
[3] https://app-updates.agilebits.com/product_history/CLI2
[4] https://releases.1password.com/developers/cli/


Replace the 1Password/connect fallback with a version check, not a different product.

1Password/connect is 1Password Connect Server, a separate product from the op CLI. The op CLI releases come from app-updates.agilebits.com/check/1/0/CLI2/en/0/N. If the primary endpoint fails, pulling from 1Password/connect writes an invalid version into the Dockerfile and breaks the PR.

Proposed fix
-          OP_LATEST=$(curl -s https://app-updates.agilebits.com/check/1/0/CLI2/en/0/N -H "User-Agent: Mozilla/5.0" | jq -r '.version // empty' || curl -s https://api.github.com/repos/1Password/connect/releases/latest | jq -r '.tag_name' | sed 's/^v//' || echo "")
+          OP_LATEST=$(curl -s https://app-updates.agilebits.com/check/1/0/CLI2/en/0/N -H "User-Agent: Mozilla/5.0" | jq -r '.version // empty' || echo "")
           if [ -z "$OP_LATEST" ]; then
-            # Fallback: use current version if can't fetch
+            # Fail closed: keep the currently pinned CLI version if the official endpoint is unavailable
             OP_LATEST="${{ steps.current.outputs.op_cli }}"
           fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/update-dev-tools.yml around lines 48 - 54, The current
OP_LATEST assignment falls back to querying 1Password/connect (wrong product)
which can produce invalid versions; update the command that sets OP_LATEST (the
variable in the script snippet) to remove the GitHub API call for
1Password/connect and instead only use the primary app-updates.agilebits.com
endpoint, and if that fails set OP_LATEST to the existing current output
(steps.current.outputs.op_cli) so the fallback is a version check from our
current build; ensure the echo "op_cli=$OP_LATEST" >> $GITHUB_OUTPUT remains
unchanged.


# Node.js LTS - nodejs.org API
NODE_LATEST=$(curl -s https://nodejs.org/dist/index.json | jq -r '[.[] | select(.lts != false)] | .[0].version' | sed 's/^v//')
echo "node=$NODE_LATEST" >> $GITHUB_OUTPUT

# pnpm - npm registry
PNPM_LATEST=$(npm view pnpm version)
echo "pnpm=$PNPM_LATEST" >> $GITHUB_OUTPUT

# Claude Code - npm registry
CLAUDE_LATEST=$(npm view @anthropic-ai/claude-code version)
echo "claude_code=$CLAUDE_LATEST" >> $GITHUB_OUTPUT

- name: Compare versions
id: compare
run: |
UPDATES=""
HAS_UPDATES="false"

compare_version() {
local name=$1 current=$2 latest=$3
if [ "$current" != "$latest" ] && [ -n "$latest" ]; then
echo "- **$name**: \`$current\` → \`$latest\`"
return 0
fi
return 1
}

if compare_version "GitHub CLI" "${{ steps.current.outputs.gh_cli }}" "${{ steps.latest.outputs.gh_cli }}" >> /tmp/updates.txt; then
HAS_UPDATES="true"
fi
if compare_version "Doppler CLI" "${{ steps.current.outputs.doppler }}" "${{ steps.latest.outputs.doppler }}" >> /tmp/updates.txt; then
HAS_UPDATES="true"
fi
if compare_version "1Password CLI" "${{ steps.current.outputs.op_cli }}" "${{ steps.latest.outputs.op_cli }}" >> /tmp/updates.txt; then
HAS_UPDATES="true"
fi
if compare_version "Node.js" "${{ steps.current.outputs.node }}" "${{ steps.latest.outputs.node }}" >> /tmp/updates.txt; then
HAS_UPDATES="true"
fi
if compare_version "pnpm" "${{ steps.current.outputs.pnpm }}" "${{ steps.latest.outputs.pnpm }}" >> /tmp/updates.txt; then
HAS_UPDATES="true"
fi
if compare_version "Claude Code" "${{ steps.current.outputs.claude_code }}" "${{ steps.latest.outputs.claude_code }}" >> /tmp/updates.txt; then
HAS_UPDATES="true"
fi

echo "has_updates=$HAS_UPDATES" >> $GITHUB_OUTPUT

{
echo "summary<<EOF"
cat /tmp/updates.txt 2>/dev/null || echo "No updates available"
echo "EOF"
} >> $GITHUB_OUTPUT

echo "Updates found: $HAS_UPDATES"
cat /tmp/updates.txt 2>/dev/null || echo "No updates"

- name: Update Dockerfile
if: steps.compare.outputs.has_updates == 'true'
run: |
# Update each version if changed
if [ "${{ steps.current.outputs.gh_cli }}" != "${{ steps.latest.outputs.gh_cli }}" ] && [ -n "${{ steps.latest.outputs.gh_cli }}" ]; then
sed -i "s/GH_CLI_VERSION=${{ steps.current.outputs.gh_cli }}/GH_CLI_VERSION=${{ steps.latest.outputs.gh_cli }}/" .devcontainer/Dockerfile
fi
if [ "${{ steps.current.outputs.doppler }}" != "${{ steps.latest.outputs.doppler }}" ] && [ -n "${{ steps.latest.outputs.doppler }}" ]; then
sed -i "s/DOPPLER_CLI_VERSION=${{ steps.current.outputs.doppler }}/DOPPLER_CLI_VERSION=${{ steps.latest.outputs.doppler }}/" .devcontainer/Dockerfile
fi
if [ "${{ steps.current.outputs.op_cli }}" != "${{ steps.latest.outputs.op_cli }}" ] && [ -n "${{ steps.latest.outputs.op_cli }}" ]; then
sed -i "s/OP_CLI_VERSION=${{ steps.current.outputs.op_cli }}/OP_CLI_VERSION=${{ steps.latest.outputs.op_cli }}/" .devcontainer/Dockerfile
fi
if [ "${{ steps.current.outputs.node }}" != "${{ steps.latest.outputs.node }}" ] && [ -n "${{ steps.latest.outputs.node }}" ]; then
sed -i "s/NODE_VERSION=${{ steps.current.outputs.node }}/NODE_VERSION=${{ steps.latest.outputs.node }}/" .devcontainer/Dockerfile
fi
if [ "${{ steps.current.outputs.pnpm }}" != "${{ steps.latest.outputs.pnpm }}" ] && [ -n "${{ steps.latest.outputs.pnpm }}" ]; then
sed -i "s/PNPM_VERSION=${{ steps.current.outputs.pnpm }}/PNPM_VERSION=${{ steps.latest.outputs.pnpm }}/" .devcontainer/Dockerfile
fi
if [ "${{ steps.current.outputs.claude_code }}" != "${{ steps.latest.outputs.claude_code }}" ] && [ -n "${{ steps.latest.outputs.claude_code }}" ]; then
sed -i "s/CLAUDE_CODE_VERSION=${{ steps.current.outputs.claude_code }}/CLAUDE_CODE_VERSION=${{ steps.latest.outputs.claude_code }}/" .devcontainer/Dockerfile
fi

- name: Create pull request
if: steps.compare.outputs.has_updates == 'true'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: fix/update-dev-tools
delete-branch: true
commit-message: 'fix: update development tools'
title: 'fix: update development tools'
body: |
## 開発ツールのバージョン更新

${{ steps.compare.outputs.summary }}

### 📝 リリースノート

- [Claude Code Releases](https://github.com/anthropics/claude-code/releases)
- [GitHub CLI Releases](https://github.com/cli/cli/releases)
- [Doppler CLI Releases](https://github.com/DopplerHQ/cli/releases)
- [1Password CLI Releases](https://developer.1password.com/docs/cli/release-notes/)
- [Node.js Releases](https://nodejs.org/en/blog/release/)
- [pnpm Releases](https://github.com/pnpm/pnpm/releases)

---

**Auto-generated by:** [update-dev-tools.yml](.github/workflows/update-dev-tools.yml)
labels: dependencies

- name: Summary
run: |
if [ "${{ steps.compare.outputs.has_updates }}" == "true" ]; then
echo "✅ PR created for development tool updates"
else
echo "ℹ️ All development tools are up to date"
fi
Loading
Loading