|
|
|
|
@ -127,84 +127,132 @@ jobs:
@@ -127,84 +127,132 @@ jobs:
|
|
|
|
|
owner: ${{ github.repository_owner }} |
|
|
|
|
repositories: ai-plugins |
|
|
|
|
|
|
|
|
|
- name: Create temporary directory for marketplace |
|
|
|
|
id: mktemp |
|
|
|
|
- name: Create Claude Code plugin directories |
|
|
|
|
run: | |
|
|
|
|
TEMP_DIR=$(mktemp -d -p .) |
|
|
|
|
echo "temp_dir=$TEMP_DIR" >> "$GITHUB_OUTPUT" |
|
|
|
|
echo "✅ Created temporary directory: $TEMP_DIR" |
|
|
|
|
mkdir -p ~/.claude/plugins/marketplaces |
|
|
|
|
mkdir -p ~/.claude/plugins/repos |
|
|
|
|
echo "✅ Created Claude Code plugin directory structure" |
|
|
|
|
|
|
|
|
|
- name: Check out AI plugins marketplace |
|
|
|
|
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 |
|
|
|
|
with: |
|
|
|
|
repository: bitwarden/ai-plugins |
|
|
|
|
path: ${{ steps.mktemp.outputs.temp_dir }} |
|
|
|
|
path: ~/.claude/plugins/marketplaces/bitwarden-marketplace |
|
|
|
|
token: ${{ steps.app-token.outputs.token }} |
|
|
|
|
persist-credentials: false |
|
|
|
|
|
|
|
|
|
- name: Configure Claude Code with local marketplace |
|
|
|
|
id: configure-marketplace |
|
|
|
|
env: |
|
|
|
|
MARKETPLACE_DIR: ${{ steps.mktemp.outputs.temp_dir }} |
|
|
|
|
- name: Initialize Claude Code plugin system |
|
|
|
|
id: init-plugins |
|
|
|
|
run: | |
|
|
|
|
MARKETPLACE_PATH="$HOME/.claude/plugins/marketplaces/bitwarden-marketplace" |
|
|
|
|
|
|
|
|
|
# Verify marketplace directory exists |
|
|
|
|
if [ ! -d "$MARKETPLACE_DIR" ]; then |
|
|
|
|
echo "❌ Error: Marketplace directory $MARKETPLACE_DIR does not exist" |
|
|
|
|
if [ ! -d "$MARKETPLACE_PATH" ]; then |
|
|
|
|
echo "❌ Error: Marketplace directory $MARKETPLACE_PATH does not exist" |
|
|
|
|
exit 1 |
|
|
|
|
fi |
|
|
|
|
echo "✅ Found marketplace at: $MARKETPLACE_DIR" |
|
|
|
|
echo "✅ Found marketplace at: $MARKETPLACE_PATH" |
|
|
|
|
|
|
|
|
|
# Verify required plugin directories exist |
|
|
|
|
if [ ! -d "$MARKETPLACE_DIR/plugins/claude-config-validator" ]; then |
|
|
|
|
if [ ! -d "$MARKETPLACE_PATH/plugins/claude-config-validator" ]; then |
|
|
|
|
echo "❌ Error: Plugin 'claude-config-validator' not found" |
|
|
|
|
exit 1 |
|
|
|
|
fi |
|
|
|
|
echo "✅ Found plugin: claude-config-validator" |
|
|
|
|
|
|
|
|
|
if [ ! -d "$MARKETPLACE_DIR/plugins/bitwarden-code-review" ]; then |
|
|
|
|
if [ ! -d "$MARKETPLACE_PATH/plugins/bitwarden-code-review" ]; then |
|
|
|
|
echo "❌ Error: Plugin 'bitwarden-code-review' not found" |
|
|
|
|
exit 1 |
|
|
|
|
fi |
|
|
|
|
echo "✅ Found plugin: bitwarden-code-review" |
|
|
|
|
|
|
|
|
|
# Verify agent file exists |
|
|
|
|
if [ -f "$MARKETPLACE_DIR/plugins/bitwarden-code-review/.claude-plugin/plugin.json" ]; then |
|
|
|
|
echo "✅ Plugin metadata found in expected location." |
|
|
|
|
# Verify plugin metadata files exist |
|
|
|
|
if [ -f "$MARKETPLACE_PATH/plugins/claude-config-validator/.claude-plugin/plugin.json" ]; then |
|
|
|
|
echo "✅ Plugin metadata found: claude-config-validator" |
|
|
|
|
else |
|
|
|
|
echo "❌ Error: Plugin metadata not found for claude-config-validator" |
|
|
|
|
exit 1 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
if [ -f "$MARKETPLACE_PATH/plugins/bitwarden-code-review/.claude-plugin/plugin.json" ]; then |
|
|
|
|
echo "✅ Plugin metadata found: bitwarden-code-review" |
|
|
|
|
else |
|
|
|
|
echo "⚠️ Warning: Plugin metadata not found at expected location" |
|
|
|
|
echo "❌ Error: Plugin metadata not found for bitwarden-code-review" |
|
|
|
|
exit 1 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
mkdir -p ~/.claude |
|
|
|
|
echo "✅ Created Claude Code configuration directory" |
|
|
|
|
# Get git commit SHA for tracking |
|
|
|
|
cd "$MARKETPLACE_PATH" |
|
|
|
|
GIT_SHA=$(git rev-parse HEAD) |
|
|
|
|
cd - > /dev/null |
|
|
|
|
echo "✅ Git commit SHA: $GIT_SHA" |
|
|
|
|
|
|
|
|
|
# Create config.json |
|
|
|
|
echo '{"repositories": {}}' > ~/.claude/plugins/config.json |
|
|
|
|
echo "✅ Created config.json" |
|
|
|
|
echo "📄 Contents of config.json:" |
|
|
|
|
cat ~/.claude/plugins/config.json |
|
|
|
|
|
|
|
|
|
# Create Claude Code configuration JSON |
|
|
|
|
SETTINGS_JSON=$(jq -n \ |
|
|
|
|
--arg path "$(realpath "$MARKETPLACE_DIR")" \ |
|
|
|
|
# Create known_marketplaces.json |
|
|
|
|
jq -n \ |
|
|
|
|
--arg path "$MARKETPLACE_PATH" \ |
|
|
|
|
--arg timestamp "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)" \ |
|
|
|
|
'{ |
|
|
|
|
extraKnownMarketplaces: { |
|
|
|
|
"bitwarden-marketplace": { |
|
|
|
|
source: { |
|
|
|
|
source: "directory", |
|
|
|
|
path: $path |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
enabledPlugins: { |
|
|
|
|
"claude-config-validator@bitwarden-marketplace": true, |
|
|
|
|
"bitwarden-code-review@bitwarden-marketplace": true |
|
|
|
|
"bitwarden-marketplace": { |
|
|
|
|
"source": { |
|
|
|
|
"source": "git", |
|
|
|
|
"url": "https://github.com/bitwarden/ai-plugins.git" |
|
|
|
|
}, |
|
|
|
|
"installLocation": $path, |
|
|
|
|
"lastUpdated": $timestamp |
|
|
|
|
} |
|
|
|
|
}') |
|
|
|
|
}' > ~/.claude/plugins/known_marketplaces.json |
|
|
|
|
echo "✅ Created known_marketplaces.json" |
|
|
|
|
echo "📄 Contents of known_marketplaces.json:" |
|
|
|
|
cat ~/.claude/plugins/known_marketplaces.json |
|
|
|
|
|
|
|
|
|
# Write to file for debugging |
|
|
|
|
echo "$SETTINGS_JSON" > ~/.claude/settings.json |
|
|
|
|
echo "✅ Created settings file at ~/.claude/settings.json" |
|
|
|
|
# Create installed_plugins.json |
|
|
|
|
jq -n \ |
|
|
|
|
--arg path "$MARKETPLACE_PATH" \ |
|
|
|
|
--arg sha "$GIT_SHA" \ |
|
|
|
|
--arg timestamp "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)" \ |
|
|
|
|
'{ |
|
|
|
|
"version": 1, |
|
|
|
|
"plugins": { |
|
|
|
|
"claude-config-validator@bitwarden-marketplace": { |
|
|
|
|
"version": "1.0.0", |
|
|
|
|
"installedAt": $timestamp, |
|
|
|
|
"lastUpdated": $timestamp, |
|
|
|
|
"installPath": ($path + "/plugins/claude-config-validator"), |
|
|
|
|
"gitCommitSha": $sha, |
|
|
|
|
"isLocal": true |
|
|
|
|
}, |
|
|
|
|
"bitwarden-code-review@bitwarden-marketplace": { |
|
|
|
|
"version": "1.2.0", |
|
|
|
|
"installedAt": $timestamp, |
|
|
|
|
"lastUpdated": $timestamp, |
|
|
|
|
"installPath": ($path + "/plugins/bitwarden-code-review"), |
|
|
|
|
"gitCommitSha": $sha, |
|
|
|
|
"isLocal": true |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}' > ~/.claude/plugins/installed_plugins.json |
|
|
|
|
echo "✅ Created installed_plugins.json" |
|
|
|
|
echo "📄 Contents of installed_plugins.json:" |
|
|
|
|
cat ~/.claude/plugins/installed_plugins.json |
|
|
|
|
|
|
|
|
|
# Output JSON to GitHub Actions output for passing to action |
|
|
|
|
echo "settings_json<<EOF" >> "$GITHUB_OUTPUT" |
|
|
|
|
echo "$SETTINGS_JSON" >> "$GITHUB_OUTPUT" |
|
|
|
|
echo "EOF" >> "$GITHUB_OUTPUT" |
|
|
|
|
# Create settings.json with enabledPlugins |
|
|
|
|
jq -n '{ |
|
|
|
|
"enabledPlugins": { |
|
|
|
|
"claude-config-validator@bitwarden-marketplace": true, |
|
|
|
|
"bitwarden-code-review@bitwarden-marketplace": true |
|
|
|
|
} |
|
|
|
|
}' > ~/.claude/settings.json |
|
|
|
|
echo "✅ Created settings.json" |
|
|
|
|
echo "📄 Contents of settings.json:" |
|
|
|
|
cat ~/.claude/settings.json |
|
|
|
|
|
|
|
|
|
echo "✅ Claude Code configured with local marketplace" |
|
|
|
|
echo "✅ Claude Code plugin system fully initialized" |
|
|
|
|
|
|
|
|
|
- name: Review with Claude Code |
|
|
|
|
timeout-minutes: 10 |
|
|
|
|
@ -213,7 +261,6 @@ jobs:
@@ -213,7 +261,6 @@ jobs:
|
|
|
|
|
anthropic_api_key: ${{ steps.get-kv-secrets.outputs.ANTHROPIC-CODE-REVIEW-API-KEY }} |
|
|
|
|
track_progress: true |
|
|
|
|
use_sticky_comment: true |
|
|
|
|
settings: ${{ steps.configure-marketplace.outputs.settings_json }} |
|
|
|
|
prompt: | |
|
|
|
|
Use bitwarden-code-reviewer agent to review the currently checked out pull request changes. |
|
|
|
|
claude_args: | |
|
|
|
|
|