Register ada-spark plugin in marketplace (25 -> 26 plugins) #432
Workflow file for this run
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 Code - Automated PR Review | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, ready_for_review, reopened] | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | |
| jobs: | |
| claude-review: | |
| # Only run for PRs created by repo owner | |
| if: github.event.pull_request.author_association == 'OWNER' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| issues: write | |
| actions: read | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check run count | |
| id: check-runs | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # Count total workflow runs for this PR (including initial opened event) | |
| # This allows exactly 3 runs: opened + first 2 pushes | |
| WORKFLOW_FILE="claude-code-review.yml" | |
| # Count completed workflow runs for this PR | |
| RUN_COUNT=$(gh api \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| "repos/${{ github.repository }}/actions/workflows/${WORKFLOW_FILE}/runs?head_sha=${{ github.event.pull_request.head.sha }}&status=completed" \ | |
| --jq '[.workflow_runs[] | select(.event == "pull_request")] | length' || echo "") | |
| # Error handling: default to 0 if API call failed or returned empty | |
| RUN_COUNT=${RUN_COUNT:-0} | |
| if ! [[ "$RUN_COUNT" =~ ^[0-9]+$ ]]; then | |
| echo "[WARN] Warning: invalid RUN_COUNT value ('$RUN_COUNT') from GitHub API. Defaulting to 0." | |
| RUN_COUNT=0 | |
| fi | |
| # Add 1 for the current run (not yet completed) | |
| RUN_COUNT=$((RUN_COUNT + 1)) | |
| echo "This is run #$RUN_COUNT for this PR (event: ${{ github.event.action }})" | |
| # Allow reviews on first 3 runs total (opened + first 2 pushes) | |
| if [ "$RUN_COUNT" -le 3 ]; then | |
| echo "should_run=true" >> $GITHUB_OUTPUT | |
| echo "[OK] Will run Claude review (run $RUN_COUNT of 3)" | |
| else | |
| echo "should_run=false" >> $GITHUB_OUTPUT | |
| echo "[SKIP] Skipping Claude review (already ran 3 times)" | |
| fi | |
| - name: Run Claude Code Review | |
| if: steps.check-runs.outputs.should_run == 'true' | |
| uses: anthropics/claude-code-action@26ec041249acb0a944c0a47b6c0c13f05dbc5b44 # v1.0.70 | |
| with: | |
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| model: claude-opus-4-5-20251101 | |
| plugin_marketplaces: 'https://github.com/anthropics/claude-code.git' | |
| plugins: 'code-review@claude-code-plugins' | |
| prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}' | |
| use_commit_signing: true | |
| - name: Comment on PR (skipped) | |
| if: steps.check-runs.outputs.should_run == 'false' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh pr comment ${{ github.event.pull_request.number }} --body "[INFO] Claude Code review was skipped as it has already run 3 times for this PR. The PR can now continue toward merge." |