diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml new file mode 100644 index 00000000..7297276c --- /dev/null +++ b/.github/workflows/claude.yml @@ -0,0 +1,34 @@ +name: Claude Code + +on: + pull_request: + branches: [main] + types: [opened, reopened, synchronize] + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + +jobs: + claude: + if: >- + (github.event_name == 'pull_request' && + github.event.pull_request.head.repo.full_name == github.repository) || + (github.event_name == 'issue_comment' && github.event.issue.pull_request && + contains(github.event.comment.body, '@claude') && + contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) || + (github.event_name == 'pull_request_review_comment' && + contains(github.event.comment.body, '@claude') && + contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) + runs-on: ubuntu-latest + timeout-minutes: 60 + permissions: + contents: read + id-token: write + pull-requests: write + issues: write + steps: + - name: Run Claude Code + uses: anthropics/claude-code-action@094bd24d575e7b30ac1576024817bf1a97c81262 # v1 + with: + anthropic_api_key: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}