Browse Source

Verify Claude plugin marketplace installation before configuring settings (#498)

pull/499/head
Patrick Honkonen 2 weeks ago committed by GitHub
parent
commit
aea1dc05fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 67
      .github/workflows/_review-code.yml

67
.github/workflows/_review-code.yml

@ -122,34 +122,64 @@ jobs: @@ -122,34 +122,64 @@ jobs:
private-key: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-KEY }}
owner: ${{ github.repository_owner }}
repositories: ai-plugins
- name: Create temporary directory for marketplace
id: mktemp
run: |
TEMP_DIR=$(mktemp -d)
echo "temp_dir=$TEMP_DIR" >> "$GITHUB_OUTPUT"
echo "✅ Created temporary directory: $TEMP_DIR"
- name: Check out AI plugins marketplace
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
repository: bitwarden/ai-plugins
path: .ai-plugins
path: ${{ steps.mktemp.outputs.temp_dir }}
token: ${{ steps.app-token.outputs.token }}
persist-credentials: false
- name: Configure Claude Code with local marketplace
env:
MARKETPLACE_DIR: ${{ steps.mktemp.outputs.temp_dir }}
run: |
mkdir -p ~/.claude
cat > ~/.claude/settings.json << 'EOF'
{
"extraKnownMarketplaces": {
"bitwarden-marketplace": {
"source": {
"source": "directory",
"path": "${{ github.workspace }}/.ai-plugins"
# Verify marketplace directory exists
if [ ! -d "$MARKETPLACE_DIR" ]; then
echo "❌ Error: Marketplace directory $MARKETPLACE_DIR does not exist"
exit 1
fi
echo "✅ Found marketplace at: $MARKETPLACE_DIR"
# Verify required plugin directories exist
if [ ! -d "$MARKETPLACE_DIR/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
echo "❌ Error: Plugin 'bitwarden-code-review' not found"
exit 1
fi
echo "✅ Found plugin: bitwarden-code-review"
# Create Claude Code configuration
jq -n \
--arg path "$MARKETPLACE_DIR" \
'{
extraKnownMarketplaces: {
"bitwarden-marketplace": {
source: {
source: "directory",
path: $path
}
}
},
enabledPlugins: {
"claude-config-validator@bitwarden-marketplace": true,
"bitwarden-code-review@bitwarden-marketplace": true
}
},
"enabledPlugins": {
"claude-config-validator@bitwarden-marketplace": true,
"bitwarden-code-review@bitwarden-marketplace": true
}
}
EOF
}' > ~/.claude/settings.json
echo "✅ Claude Code configured with local marketplace"
- name: Review with Claude Code
@ -159,6 +189,7 @@ jobs: @@ -159,6 +189,7 @@ jobs:
anthropic_api_key: ${{ steps.get-kv-secrets.outputs.ANTHROPIC-CODE-REVIEW-API-KEY }}
track_progress: true
use_sticky_comment: true
prompt: "Use @agent-bitwarden-code-review:bitwarden-code-reviewer to review the currently checked out pull request changes."
prompt: |
Use @agent-bitwarden-code-review:bitwarden-code-reviewer to review the currently checked out pull request changes.
claude_args: |
--allowedTools "mcp__github_comment__update_claude_comment,mcp__github_inline_comment__create_inline_comment,Bash(gh pr diff:*),Bash(gh pr view:*)"

Loading…
Cancel
Save