feat: add mermaid diagram rendering with interactive zoom overlay to mdbook docs #175
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Claude PR Review | |
| on: | |
| issue_comment: | |
| types: [created] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| issues: write | |
| id-token: write | |
| jobs: | |
| claude: | |
| if: | | |
| github.event.issue.pull_request && | |
| contains(github.event.comment.body, '/claude') && | |
| contains(fromJson('["OWNER","COLLABORATOR"]'), github.event.comment.author_association) | |
| runs-on: macos-latest | |
| steps: | |
| - name: Add reaction to comment | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 | |
| with: | |
| script: | | |
| await github.rest.reactions.createForIssueComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: context.payload.comment.id, | |
| content: 'eyes' | |
| }); | |
| - name: Get PR details | |
| id: pr | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 | |
| with: | |
| script: | | |
| const pr = await github.rest.pulls.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.issue.number | |
| }); | |
| core.setOutput('head_sha', pr.data.head.sha); | |
| core.setOutput('head_repo', pr.data.head.repo.full_name); | |
| core.setOutput('head_ref', pr.data.head.ref); | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| repository: ${{ steps.pr.outputs.head_repo }} | |
| ref: ${{ steps.pr.outputs.head_ref }} | |
| - name: Run Claude Code | |
| uses: anthropics/claude-code-action@ba7fa4bcf054319261202aef93d71a89112a8d00 # v1.0.64 | |
| with: | |
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| model: ${{ vars.CLAUDE_MODEL || 'claude-sonnet-4-20250514' }} | |
| trigger_phrase: "/claude" | |
| allowed_tools: "Bash,Read,Glob,Grep,Edit,Write" | |
| custom_instructions: | | |
| You are reviewing a PostgreSQL C++ extension project (pg_ai_query). | |
| Before reviewing, check the PR body for linked issues (e.g. "Fixes #123", "Closes #456"). | |
| If found, fetch their details with: gh issue view <number> --repo $GITHUB_REPOSITORY | |
| Use the issue context to understand the intent behind the changes. | |
| When asked to review: | |
| 1. Analyze the PR changes against linked issue requirements (if present) | |
| 2. Build the project: mkdir -p build && cd build && cmake .. && make | |
| 3. Run any available tests | |
| 4. Provide feedback on: | |
| - C++ code quality and best practices | |
| - PostgreSQL extension patterns (SPI, memory contexts, ereport) | |
| - Security issues (SQL injection, API key exposure) | |
| - Build errors or warnings | |
| Be concise and actionable. Fix simple issues directly if asked. | |
| - name: Add success reaction | |
| if: success() | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 | |
| with: | |
| script: | | |
| await github.rest.reactions.createForIssueComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: context.payload.comment.id, | |
| content: 'rocket' | |
| }); |