Skip to content

Commit 085c21a

Browse files
cosminachoclaude
andcommitted
ci: add Claude workflow to solve assigned issues and open PRs
Add a GitHub Actions workflow using anthropics/claude-code-action@v1. When an issue is assigned to the Claude account, Claude investigates, implements a fix on a new branch following the repo conventions in .claude/CLAUDE.md (versioning, pre-commit checklist), and opens a PR that closes the issue. Also responds to @claude mentions in issue/PR comments and reviews. Requires a repo admin to install the Claude GitHub App and add an ANTHROPIC_API_KEY secret (or CLAUDE_CODE_OAUTH_TOKEN); documented inline. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3c8ebcc commit 085c21a

1 file changed

Lines changed: 90 additions & 0 deletions

File tree

.github/workflows/claude.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Claude
2+
3+
# Lets Claude act on issues and pull requests.
4+
#
5+
# Triggers:
6+
# * Assign an issue to the configured account (see `assignee_trigger` below) and
7+
# Claude will investigate, implement a fix on a new branch, and open a PR that
8+
# references the issue.
9+
# * Mention `@claude` in an issue comment, PR comment, or PR review and Claude
10+
# will respond / make the requested change on that thread.
11+
#
12+
# Setup (one-time, done by a repo admin):
13+
# 1. Install the Claude GitHub App on this repository
14+
# (https://github.com/apps/claude) so an assignable bot account exists, OR
15+
# pick an existing machine-user login and set `assignee_trigger` to it.
16+
# 2. Add a repository secret named `ANTHROPIC_API_KEY` (Settings → Secrets and
17+
# variables → Actions). To use a Claude subscription instead of an API key,
18+
# replace it with `CLAUDE_CODE_OAUTH_TOKEN` below.
19+
20+
on:
21+
issues:
22+
types: [assigned]
23+
issue_comment:
24+
types: [created]
25+
pull_request_review_comment:
26+
types: [created]
27+
pull_request_review:
28+
types: [submitted]
29+
30+
jobs:
31+
claude:
32+
# Only run when an issue is assigned to the Claude account, or when @claude is
33+
# mentioned. This keeps the job from spinning up on every comment/assignment.
34+
if: |
35+
(github.event_name == 'issues' && github.event.assignee.login == 'claude') ||
36+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
37+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
38+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude'))
39+
runs-on: ubuntu-latest
40+
permissions:
41+
contents: write # create branches and commits
42+
pull-requests: write # open PRs and comment
43+
issues: write # comment on issues
44+
id-token: write # OIDC for the action
45+
steps:
46+
- name: Checkout repository
47+
uses: actions/checkout@v6
48+
with:
49+
fetch-depth: 0
50+
lfs: true
51+
52+
- name: Run Claude Code
53+
uses: anthropics/claude-code-action@v1
54+
with:
55+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
56+
# To use a Claude subscription instead of an API key, remove the line
57+
# above and uncomment:
58+
# claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
59+
60+
# Account that issues are assigned to in order to trigger Claude.
61+
assignee_trigger: "claude"
62+
# Phrase that triggers Claude in comments and reviews.
63+
trigger_phrase: "@claude"
64+
65+
# Repo-specific instructions. The action automatically injects the
66+
# triggering issue / comment and its context; this tells Claude how to
67+
# work in THIS monorepo and to deliver the result as a PR.
68+
prompt: |
69+
You are working in the `uipath-llm-client` Python monorepo. A GitHub
70+
issue or comment has triggered you — read it (and any code it links to)
71+
and fully resolve the request.
72+
73+
Follow the repository conventions in `.claude/CLAUDE.md` exactly. In
74+
particular:
75+
- Apply the versioning rules: when you change source under `src/` or
76+
`packages/`, bump the affected `__version__.py`, update the matching
77+
dependency pin, and add CHANGELOG entries.
78+
- Run the full pre-commit checklist and make sure all of it passes
79+
before committing:
80+
`uv sync --all-extras`
81+
`uv run ruff check && uv run ruff format . && uv run pyright && uv run pytest tests`
82+
- Keep the change focused: one logical change.
83+
84+
When the work is done and the checks pass, push a branch and open a pull
85+
request whose description explains what changed and why, which package(s)
86+
are affected, and that closes the issue (e.g. "Fixes #<number>").
87+
88+
# Tune the agent's run. Bump --max-turns for larger issues.
89+
claude_args: |
90+
--max-turns 40

0 commit comments

Comments
 (0)