Skip to content

Commit 5e4f7cf

Browse files
authored
chore(ci): add Claude Code GitHub Workflow (#2881)
1 parent 5ace714 commit 5e4f7cf

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

.github/workflows/claude.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Claude Code
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened, assigned]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
jobs:
14+
claude:
15+
if: |
16+
(github.event.sender.login == 'olimorris') &&
17+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
18+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
19+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
20+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
pull-requests: read
25+
issues: read
26+
id-token: write
27+
actions: read # Required for Claude to read CI results on PRs
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 1
33+
34+
- name: Run Claude Code
35+
id: claude
36+
uses: anthropics/claude-code-action@v1
37+
with:
38+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39+
40+
# This is an optional setting that allows Claude to read CI results on PRs
41+
additional_permissions: |
42+
actions: read
43+
44+
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
45+
# prompt: 'Update the pull request description to include a summary of changes.'
46+
47+
# Optional: Add claude_args to customize behavior and configuration
48+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
49+
# or https://code.claude.com/docs/en/cli-reference for available options
50+
# claude_args: '--allowed-tools Bash(gh pr:*)'
51+

0 commit comments

Comments
 (0)