Skip to content

Commit ba7cde5

Browse files
Fixed claude
1 parent 1b22e2e commit ba7cde5

2 files changed

Lines changed: 184 additions & 2 deletions

File tree

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
# 🔧 Troubleshooting: Claude Not Responding to @claude
2+
3+
## Quick Checklist
4+
5+
### ✅ 1. Verify API Key is Set
6+
Go to: `Settings → Secrets and variables → Actions`
7+
- Check that `ANTHROPIC_API_KEY` exists
8+
- Name must be **exactly** `ANTHROPIC_API_KEY` (case-sensitive)
9+
10+
### ✅ 2. Check Workflow Permissions
11+
Go to: `Settings → Actions → General → Workflow permissions`
12+
- Select: **Read and write permissions**
13+
- Enable: **Allow GitHub Actions to create and approve pull requests**
14+
- Click **Save**
15+
16+
### ✅ 3. Verify Workflows Are Enabled
17+
Go to: `Actions` tab
18+
- Check if workflows are showing in the left sidebar
19+
- If you see a yellow banner saying "Workflows aren't being run on this repository", click **Enable workflows**
20+
21+
### ✅ 4. Check Workflow Files Are in Correct Location
22+
Files must be in: `.github/workflows/` directory
23+
24+
```bash
25+
# Correct structure:
26+
.github/
27+
workflows/
28+
claude-pr-review.yml
29+
claude-issue-assistant.yml
30+
```
31+
32+
### ✅ 5. For Issues - How to Trigger Claude
33+
34+
**Option 1: Mention @claude in issue body when creating**
35+
```
36+
Title: How do I add a new service?
37+
Body: @claude Can you help me understand the architecture?
38+
```
39+
40+
**Option 2: Add a label**
41+
Create issue with label: `help-wanted` or `question`
42+
43+
**Option 3: Comment with @claude**
44+
```
45+
@claude What's the best way to do this?
46+
```
47+
48+
## 🔍 Debug Steps
49+
50+
### Step 1: Check Workflow Runs
51+
1. Go to **Actions** tab in your repo
52+
2. Look for workflow runs named "Claude Issue Assistant"
53+
3. Click on a run to see details
54+
55+
**What to look for:**
56+
- ❌ Red X = Failed (click to see error logs)
57+
- ⚪ Gray circle = Skipped (workflow conditions not met)
58+
- ✅ Green check = Success
59+
60+
### Step 2: Check the "if" Condition
61+
If workflow shows as "skipped", the `if` condition didn't pass.
62+
63+
**For Issues**, check if ANY of these are true:
64+
- Issue has `help-wanted` label
65+
- Issue has `question` label
66+
- Issue body contains `@claude`
67+
- Comment contains `@claude`
68+
69+
### Step 3: View Workflow Logs
70+
1. Click on a workflow run
71+
2. Click on the job "claude-issue-help"
72+
3. Expand each step to see detailed logs
73+
4. Look for errors in red
74+
75+
**Common errors:**
76+
```
77+
Error: ANTHROPIC_API_KEY not found
78+
→ Solution: Add the secret in Settings
79+
80+
Error: Resource not accessible by integration
81+
→ Solution: Enable workflow permissions
82+
83+
Error: 401 Unauthorized
84+
→ Solution: API key is invalid, regenerate it
85+
```
86+
87+
## 🧪 Test the Workflow
88+
89+
### Test 1: Simple Issue with @claude
90+
1. Create a new issue
91+
2. Title: "Test Claude Integration"
92+
3. Body: "@claude Hello, are you working?"
93+
4. Submit
94+
5. Go to Actions tab and watch for workflow run
95+
96+
### Test 2: Issue Comment
97+
1. Open any existing issue
98+
2. Add a comment: "@claude Can you help?"
99+
3. Submit
100+
4. Check Actions tab
101+
102+
### Test 3: Issue with Label
103+
1. Create issue without @claude
104+
2. Add label `question`
105+
3. Check Actions tab
106+
107+
## 🐛 Still Not Working?
108+
109+
### Check GitHub Actions Status
110+
Sometimes GitHub Actions itself has issues: https://www.githubstatus.com/
111+
112+
### Enable Debug Logging
113+
Add these secrets to get more detailed logs:
114+
- `ACTIONS_RUNNER_DEBUG` = `true`
115+
- `ACTIONS_STEP_DEBUG` = `true`
116+
117+
### Validate YAML Syntax
118+
Copy your workflow file and check at: https://www.yamllint.com/
119+
120+
### Check Repository Settings
121+
Go to `Settings → Actions → General`
122+
- "Actions permissions" should be: **Allow all actions and reusable workflows**
123+
- "Fork pull request workflows" settings may affect behavior
124+
125+
## 📋 Manual Verification Checklist
126+
127+
Copy this checklist and verify each item:
128+
129+
```
130+
Repository: rodrigorodrigues/microservices-design-patterns
131+
132+
□ ANTHROPIC_API_KEY exists in Secrets
133+
□ Workflow permissions set to "Read and write"
134+
□ "Allow GitHub Actions to create and approve pull requests" enabled
135+
□ Workflows are in .github/workflows/ directory
136+
□ Files are named exactly: claude-issue-assistant.yml
137+
□ GitHub Actions are enabled for the repository
138+
□ Issue contains @claude OR has help-wanted/question label
139+
□ No syntax errors in YAML files
140+
□ API key is valid (test at console.anthropic.com)
141+
```
142+
143+
## 💡 Common Gotchas
144+
145+
1. **@claude vs @Claude**: Matching is case-sensitive, use lowercase `@claude`
146+
147+
2. **Label names**: Must be exactly `help-wanted` or `question` (with dash, not space)
148+
149+
3. **First time setup**: First workflow run may take 1-2 minutes to start
150+
151+
4. **Workflow file changes**: After updating .yml files, it may take 30 seconds to reflect
152+
153+
5. **Multiple workflows**: If you have multiple workflow files, make sure you're looking at the right one
154+
155+
## 🎯 Expected Behavior
156+
157+
**When working correctly:**
158+
159+
1. You mention @claude in an issue or comment
160+
2. Within 30-60 seconds, workflow appears in Actions tab
161+
3. Workflow runs (shows as yellow/in progress)
162+
4. After 30-90 seconds, Claude posts a comment on the issue
163+
5. Comment starts with "🤖 Claude AI Assistant"
164+
165+
**Timing:**
166+
- Workflow trigger: ~10-30 seconds
167+
- Workflow execution: ~30-60 seconds
168+
- Total: ~1-2 minutes from @claude to response
169+
170+
## 🆘 Get Help
171+
172+
If still stuck, create an issue with:
173+
1. Screenshot of Actions tab showing workflow runs
174+
2. Screenshot of Settings → Actions → General
175+
3. Copy of error logs from failed workflow run
176+
4. Confirm you completed all checklist items above
177+
178+
---
179+
180+
**Quick Test Command:**
181+
Create issue titled "Test" with body "@claude hello" and wait 2 minutes. If no response, check Actions tab for errors.

.github/workflows/claude-issue-assistant.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ permissions:
1212

1313
jobs:
1414
claude-issue-help:
15-
# Only run if issue has 'help-wanted' or 'question' label, or comment mentions @claude
15+
# Run if: issue has labels, issue body mentions @claude, or comment mentions @claude
1616
if: |
1717
(github.event_name == 'issues' &&
1818
(contains(github.event.issue.labels.*.name, 'help-wanted') ||
19-
contains(github.event.issue.labels.*.name, 'question'))) ||
19+
contains(github.event.issue.labels.*.name, 'question') ||
20+
contains(github.event.issue.body, '@claude'))) ||
2021
(github.event_name == 'issue_comment' &&
2122
!github.event.issue.pull_request &&
2223
contains(github.event.comment.body, '@claude'))

0 commit comments

Comments
 (0)