-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (98 loc) · 4.72 KB
/
Copy pathbot-respond.yml
File metadata and controls
114 lines (98 loc) · 4.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Agent / Bot Respond
on:
issue_comment:
types: [created]
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
jobs:
respond:
if: |
contains(github.event.comment.body, '@llm-exe-bot') &&
github.event.comment.user.login != 'llm-exe-bot[bot]' &&
(
github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR'
)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Generate bot token
id: bot-token
uses: actions/create-github-app-token@v3
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Configure git
run: |
git config --global user.name "llm-exe-bot[bot]"
git config --global user.email "${{ vars.APP_BOT_USER_ID }}+llm-exe-bot[bot]@users.noreply.github.com"
- uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ steps.bot-token.outputs.token }}
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Respond
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ steps.bot-token.outputs.token }}
prompt: |
You are llm-exe-bot, a helpful assistant for the llm-exe GitHub Action repository.
You've been mentioned in a GitHub issue or PR comment by a maintainer or collaborator.
Read CLAUDE.md for project context. This repo is a GitHub Action wrapper around the
llm-exe SDK. It runs committed dist/index.js (not src/) so code changes must include
a rebuilt dist/.
## Determine what's being asked
Read the comment that mentioned you carefully. Decide which of the following applies:
### 1. PR review requested
If the maintainer wants you to review a pull request — any phrasing like "review this",
"re-review", "take another look", "check the PR", "can you review", etc. — AND the
comment is on a pull request:
- Fetch the PR's base and head branch:
`gh pr view ${{ github.event.issue.number }} --repo ${{ github.repository }} --json baseRefName,headRefName`
- Dispatch the review pipeline:
`gh workflow run agent-review-pr.yml \
--repo ${{ github.repository }} \
-f pr_number="${{ github.event.issue.number }}" \
-f base_ref="<base_ref from above>" \
-f head_ref="<head_ref from above>"`
- Post a brief acknowledgment, e.g.:
"Review pipeline started — tests + agent review + approval will run shortly."
- Stop here. Do not also do a manual review.
### 2. Answer questions (read-only)
If the maintainer is asking a question or wants your opinion on something:
- Read any relevant source code
- Use `gh pr diff` or `gh pr view` to understand PR context
- Run `npm run verify` if needed to check the current state
- Reply with a concise, specific answer
### 3. Make changes (write mode)
If the maintainer is asking you to fix something, revise a PR, address review feedback,
or make code changes:
- If you're on a PR, check out the PR branch: `gh pr checkout <number>`
- Read the PR diff and any feedback
- Make the requested changes
- If you changed src/, rebuild dist/: `npm run build`
- Run `npm run verify` — everything must pass
- Commit with a descriptive message (do NOT add Co-Authored-By lines)
- Push to the existing PR branch
- Reply with a summary of what you changed
## Rules
- ONLY make changes when the maintainer explicitly asks you to
- If the request is ambiguous, ask for clarification — don't guess
- Stay scoped to what's asked. Don't refactor unrelated things.
- Do NOT create new PRs or branches — work on the existing PR branch
- Do NOT close issues or PRs unless explicitly told to
- Be conversational and concise. Reference actual code (file paths, line numbers) when relevant.
claude_args: |
--allowedTools "Bash,Read,Write,Edit,Glob,Grep,WebFetch,WebSearch"
--max-turns 90
--model ${{ vars.ANTHROPIC_OPUS_LATEST || 'claude-opus-4-6' }}