diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 9141f0c8..7ec65efa 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -37,7 +37,7 @@ 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 }}' + prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }} --comment' # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://code.claude.com/docs/en/cli-reference for available options diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml new file mode 100644 index 00000000..6e78ca15 --- /dev/null +++ b/.github/workflows/claude.yml @@ -0,0 +1,44 @@ +name: Claude Code + +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + pull_request_review: + types: [submitted] + issues: + types: [opened, assigned] + +jobs: + claude: + # Only respond when the repository owner mentions @claude. + if: | + (github.event_name == 'issue_comment' && github.event.comment.user.login == 'yukinarit' && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review_comment' && github.event.comment.user.login == 'yukinarit' && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review' && github.event.review.user.login == 'yukinarit' && contains(github.event.review.body, '@claude')) || + (github.event_name == 'issues' && github.event.sender.login == 'yukinarit' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) + + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + issues: write + id-token: write + actions: read # Required for Claude to read CI results on PRs + + steps: + - name: Checkout repository + uses: actions/checkout@v7 + with: + fetch-depth: 1 + + - name: Run Claude Code + id: claude + uses: anthropics/claude-code-action@v1 + with: + claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + additional_permissions: | + actions: read + # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md + # or https://code.claude.com/docs/en/cli-reference for available options