claude.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. name: Claude Code
  2. on:
  3. issue_comment:
  4. types: [created]
  5. pull_request_review_comment:
  6. types: [created]
  7. pull_request_review:
  8. types: [submitted]
  9. concurrency:
  10. group: claude-${{ github.event.pull_request.number || github.event.issue.number }}
  11. cancel-in-progress: true
  12. jobs:
  13. claude:
  14. if: |
  15. (github.event_name != 'issue_comment' || github.event.issue.pull_request != null)
  16. && contains(github.event.comment.body || github.event.review.body, '@claude')
  17. && (github.event.comment.user.type || github.event.review.user.type) != 'Bot'
  18. && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association || github.event.review.author_association)
  19. runs-on: ubuntu-latest
  20. timeout-minutes: 15
  21. permissions:
  22. contents: read
  23. issues: write
  24. pull-requests: write
  25. actions: read # Required for Claude to read CI results on PRs
  26. steps:
  27. - name: Checkout repository
  28. uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
  29. with:
  30. fetch-depth: 1
  31. - name: Run Claude Code
  32. id: claude
  33. uses: anthropics/claude-code-action@11a9dadd198803a0cea6bd53da3e0e8a762fc6ea # v1.0.108
  34. with:
  35. anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
  36. github_token: ${{ secrets.GITHUB_TOKEN }}