forked from humanlayer/humanlayer
-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (104 loc) · 4.37 KB
/
claude.yml
File metadata and controls
124 lines (104 loc) · 4.37 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
115
116
117
118
119
120
121
122
123
124
name: Claude Code
on:
workflow_dispatch:
inputs:
prompt:
description: "Prompt for Claude"
required: true
type: string
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude') &&
(github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude') &&
(github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude') &&
(github.event.review.author_association == 'OWNER' || github.event.review.author_association == 'MEMBER' || github.event.review.author_association == 'COLLABORATOR')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')) &&
(github.event.issue.author_association == 'OWNER' || github.event.issue.author_association == 'MEMBER' || github.event.issue.author_association == 'COLLABORATOR'))
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Add Go bin to PATH
run: echo "$HOME/go/bin" >> $GITHUB_PATH
- name: Setup repository
run: make setup
- name: Checkout thoughts repository
uses: actions/checkout@v4
with:
repository: humanlayer/thoughts
ref: main
ssh-key: ${{ secrets.THOUGHTS_WRITE_DEPLOY_KEY }}
path: thoughts
- name: Install humanlayer CLI globally
run: npm install -g humanlayer
- name: Setup thoughts tool config
run: |
echo '{
"thoughts": {
"thoughtsRepo": "${{ github.workspace }}/thoughts",
"reposDir": "repos",
"globalDir": "global",
"user": "claude",
"repoMappings": {}
}
}' >> .humanlayer.json
- name: Initialize thoughts tool
run: humanlayer thoughts init --config-file .humanlayer.json --directory humanlayer
- name: Setup linear tool
run: |
cd hack/linear && npm install && npm install -g .
- name: Configure git user
run: |
git config --global user.email "[email protected]"
git config --global user.name "Claude"
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@beta
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
model: "claude-opus-4-20250514"
# Optional: Customize the trigger phrase (default: @claude)
# trigger_phrase: "/claude"
# Optional: Trigger when specific user is assigned to an issue
assignee_trigger: "claude-bot"
# Optional: Allow Claude to run specific commands
# allowed_tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
# Custom instructions including manual prompt when triggered via workflow_dispatch
prompt: |
${{ github.event_name == 'workflow_dispatch' && github.event.inputs.prompt || '' }}
# Custom environment variables for Claude
claude_env: |
GH_TOKEN: ${{ github.token }}
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}