Skip to content

Commit 1e191a0

Browse files
committed
claude code & devbord
1 parent 72c9c51 commit 1e191a0

File tree

3 files changed

+201
-0
lines changed

3 files changed

+201
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Claude Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
# Optional: Only run on specific file changes
7+
# paths:
8+
# - "src/**/*.ts"
9+
# - "src/**/*.tsx"
10+
# - "src/**/*.js"
11+
# - "src/**/*.jsx"
12+
13+
jobs:
14+
claude-review:
15+
# Optional: Filter by PR author
16+
# if: |
17+
# github.event.pull_request.user.login == 'external-contributor' ||
18+
# github.event.pull_request.user.login == 'new-developer' ||
19+
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20+
21+
runs-on: 'ubuntu-latest'
22+
permissions:
23+
contents: read
24+
pull-requests: read
25+
issues: read
26+
id-token: write
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 1
33+
34+
- name: Run Claude Code Review
35+
id: claude-review
36+
uses: anthropics/claude-code-action@v1
37+
with:
38+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39+
use_sticky_comment: true
40+
prompt: |
41+
REPO: ${{ github.repository }}
42+
PR NUMBER: ${{ github.event.pull_request.number }}
43+
44+
Please review this pull request and provide feedback on:
45+
- Code quality and best practices
46+
- Potential bugs or issues
47+
- Performance considerations
48+
- Security concerns
49+
- Test coverage
50+
51+
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
52+
53+
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
54+
55+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
56+
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
57+
claude_args: '--allowed-tools Bash,WebSearch,WebFetch'
58+

.github/workflows/claude.yml

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

.github/workflows/devbird.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: 'DevBird'
2+
run-name: 'DevBird: ${{ inputs.task_title }}'
3+
4+
env:
5+
DEVBIRD: 1
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
devbird_api_url:
11+
description: "The URL of the DevBird instance"
12+
type: string
13+
required: false
14+
default: 'https://devbird.api.delino.io'
15+
16+
prompt:
17+
description: "Instructions for DevBird. Can be a direct prompt or custom template."
18+
type: string
19+
required: true
20+
21+
base_branch:
22+
description: "The branch to use as the base/source when creating new branches (defaults to repository default branch)"
23+
type: string
24+
required: false
25+
default: 'main'
26+
27+
agent:
28+
description: "The agent to use for the action. Can be 'claude_code', 'gemini_cli', 'codex_cli' or 'opencode'"
29+
type: choice
30+
default: 'claude_code'
31+
options:
32+
- claude_code
33+
- gemini_cli
34+
- codex_cli
35+
- opencode
36+
- crush_cli
37+
- github_copilot_cli
38+
39+
agent_model:
40+
description: "The (optional) model to use for the agent"
41+
type: string
42+
required: false
43+
default: ''
44+
45+
46+
devbird_workflow_execution_token:
47+
description: "The token to use for the DevBird task"
48+
type: string
49+
required: false
50+
default: ''
51+
52+
devbird_mode:
53+
description: "The DevBird execution mode. Can be 'develop' (default) or 'plan' (for task graph planning)"
54+
type: choice
55+
default: 'develop'
56+
options:
57+
- develop
58+
- plan
59+
60+
task_title:
61+
description: "The title of the DevBird task"
62+
type: string
63+
required: false
64+
default: ''
65+
66+
jobs:
67+
devbird:
68+
runs-on: 'ubuntu-latest'
69+
permissions:
70+
contents: write
71+
pull-requests: write
72+
issues: write
73+
id-token: write
74+
actions: read # Required for Claude to read CI results on PRs
75+
steps:
76+
- name: Checkout code
77+
uses: actions/checkout@v5
78+
79+
- name: Run DevBird
80+
uses: delinoio/devbird-action@main
81+
with:
82+
agent: ${{ inputs.agent }}
83+
agent_model: ${{ inputs.agent_model }}
84+
devbird_mode: ${{ inputs.devbird_mode }}
85+
devbird_workflow_execution_token: ${{ inputs.devbird_workflow_execution_token }}
86+
prompt: ${{ inputs.prompt }}
87+
base_branch: ${{ inputs.base_branch }}
88+
delino_access_token: ${{ secrets.DELINO_ACCESS_TOKEN }}
89+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
90+
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
91+
gemini_api_key: ${{ secrets.DEVBIRD_GEMINI_API_KEY }}
92+
env:
93+
DEVBIRD_API_URL: ${{ inputs.devbird_api_url }}

0 commit comments

Comments
 (0)