diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 97e0c13..1e9b987 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -3,15 +3,27 @@ name: Claude Code Review on: pull_request: types: [opened, synchronize, ready_for_review, reopened] + # manual re-run from the Actions tab (or `gh workflow run`) + workflow_dispatch: + inputs: + pr_number: + description: 'PR number to review' + required: true + type: number + show_full_output: + description: "Show Claude's full output in the job log (visible to anyone who can see the run)" + required: false + default: false + type: boolean concurrency: - group: claude-review-${{ github.event.pull_request.number }} + group: claude-review-${{ github.event.pull_request.number || inputs.pr_number }} cancel-in-progress: true jobs: claude-review: # skip drafts; review once marked ready - if: github.event.pull_request.draft == false + if: github.event_name == 'workflow_dispatch' || github.event.pull_request.draft == false runs-on: ubuntu-latest permissions: contents: read @@ -24,6 +36,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 1 + ref: ${{ github.event_name == 'workflow_dispatch' && format('refs/pull/{0}/head', inputs.pr_number) || '' }} - name: Run Claude Code Review uses: anthropics/claude-code-action@v1 @@ -31,4 +44,5 @@ jobs: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} 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 }} --comment' + show_full_output: ${{ inputs.show_full_output == true }} + prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number || inputs.pr_number }} --comment'