From a09d8c93c4bf689bca8b53dcc828628ba2b7a390 Mon Sep 17 00:00:00 2001 From: ancplua Date: Tue, 5 May 2026 05:53:58 +0200 Subject: [PATCH] ci: revert workflow_dispatch from Claude code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per anthropics/claude-code-action docs (custom-automations.md), workflow_dispatch is "coming soon" — the action reads PR_NUMBER from github.event.pull_request.number || github.event.issue.number, so a dispatched run has no PR context and exits during the action's main step. Reverts the trigger and the gh-pr-view resolver added in #101. Doubles as a real-PR exercise of the rotated CLAUDE_CODE_OAUTH_TOKEN. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/claude-code-review.yml | 30 +++++------------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 302cba4..3ace923 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -1,12 +1,6 @@ name: Claude Code Review on: - workflow_dispatch: - inputs: - pr_number: - description: 'PR number to review' - required: true - type: string pull_request: types: [opened, synchronize, ready_for_review, reopened] paths-ignore: @@ -23,30 +17,18 @@ permissions: jobs: claude-review: if: | - github.event_name == 'workflow_dispatch' || ( - github.actor != 'coderabbitai[bot]' && - !contains(github.event.pull_request.title, '[skip review]') && - !contains(github.event.pull_request.labels.*.name, 'skip-review') - ) + github.actor != 'coderabbitai[bot]' && + !contains(github.event.pull_request.title, '[skip review]') && + !contains(github.event.pull_request.labels.*.name, 'skip-review') concurrency: - group: claude-review-${{ github.event.pull_request.number || inputs.pr_number }} + group: claude-review-${{ github.event.pull_request.number }} cancel-in-progress: true runs-on: ubuntu-latest steps: - - name: Resolve PR - id: pr - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUMBER: ${{ github.event.pull_request.number || inputs.pr_number }} - run: | - HEAD_REF=$(gh pr view "$PR_NUMBER" --repo "${{ github.repository }}" --json headRefName -q .headRefName) - echo "number=$PR_NUMBER" >> "$GITHUB_OUTPUT" - echo "head_ref=$HEAD_REF" >> "$GITHUB_OUTPUT" - - name: Checkout PR head uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: - ref: ${{ steps.pr.outputs.head_ref }} + ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 20 - name: Run Claude Code Review (agentic) @@ -60,7 +42,7 @@ jobs: plugins: 'code-review@claude-code-plugins' claude_args: '--model claude-opus-4-7 --max-turns 25' prompt: | - /code-review:code-review ${{ github.repository }}/pull/${{ steps.pr.outputs.number }} + /code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }} Operating mode: **agentic**. You have write access to this PR branch.