Skip to content
Merged
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
50 changes: 50 additions & 0 deletions .github/workflows/opencode-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# OpenCode Review
#
# Automatically reviews pull requests using OpenCode with Claude
# via Google Vertex AI.
#
# Checks for code duplication, backward compatibility, test quality,
# and design patterns.
#
# Requires:
# - GCP_SA_KEY secret (minified service account JSON key)
# - GOOGLE_CLOUD_PROJECT secret (Google Cloud project ID)
# - VERTEX_LOCATION variable (optional, defaults to us-east5)

name: OpenCode Review

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
review:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: write
issues: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: google-github-actions/auth@v3
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}

- uses: anomalyco/opencode/github@latest
env:
GOOGLE_CLOUD_PROJECT: ${{ secrets.GOOGLE_CLOUD_PROJECT }}
VERTEX_LOCATION: ${{ vars.VERTEX_LOCATION || 'us-east5' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
model: google-vertex-anthropic/claude-sonnet-4-20250514
use_github_token: true
prompt: |
Review this pull request for the productmd Python library:
- No code duplication: flag logic in the PR that duplicates existing functions or patterns already in the codebase
- Backward compatibility: flag breaking changes to public API (renamed methods, changed return types, removed parameters)
- Test quality: flag tests that only check happy paths, miss edge cases, or use overly permissive assertions. Check for missing negative tests with unexpected or malformed inputs (wrong types, empty values, None, special characters)
- Design: suggest simplifications or flag fragile patterns
Loading