Skip to content

Commit 436d034

Browse files
committed
feat: Add enhanced GitHub Actions bot integration
- Created comprehensive GitHub Actions workflows for bot operations - Added RooCode Agent bot script with /roo command support - Implemented GitHubActionsService for workflow management - Added UI component for GitHub Actions bot configuration - Updated command registration and message types - Added configuration settings for GitHub Actions bot - Included localization strings for new features - Fixed all linting issues Features: - Issue triage and labeling - PR review capabilities - /roo command triggers (plan, approve, fix, review, triage, label) - Plan generation with approval workflow - Environment secrets configuration for models - Support for multiple AI providers (Anthropic, OpenAI, OpenRouter) Addresses #8202
1 parent ceb9d2b commit 436d034

File tree

14 files changed

+1613
-5
lines changed

14 files changed

+1613
-5
lines changed

.github/scripts/README.md

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# RooCode Agent - GitHub Actions Bot
2+
3+
This directory contains the RooCode Agent bot that runs in GitHub Actions to automatically handle issues and pull requests.
4+
5+
## Features
6+
7+
The RooCode Agent bot supports the following commands:
8+
9+
### Issue Commands
10+
11+
- `/roo` - General command to interact with the bot
12+
- `/roo plan` - Create a detailed implementation plan for an issue
13+
- `/roo approve` - Approve a plan and start implementation
14+
- `/roo fix` - Directly implement a fix for an issue
15+
- `/roo triage` - Analyze and triage an issue (priority, labels, complexity)
16+
- `/roo label` - Automatically add appropriate labels to an issue
17+
18+
### Pull Request Commands
19+
20+
- `/roo review` - Perform a code review on a pull request
21+
- `/roo` - General interaction with the bot on PRs
22+
23+
## Setup Instructions
24+
25+
### 1. Repository Secrets
26+
27+
Configure the following secrets in your repository settings (`Settings > Secrets and variables > Actions`):
28+
29+
**Required (at least one):**
30+
31+
- `OPENAI_API_KEY` - OpenAI API key for GPT models
32+
- `ANTHROPIC_API_KEY` - Anthropic API key for Claude models
33+
- `OPENROUTER_API_KEY` - OpenRouter API key for various models
34+
35+
**Automatic:**
36+
37+
- `GITHUB_TOKEN` - Automatically provided by GitHub Actions
38+
39+
### 2. Repository Variables
40+
41+
Configure these variables in your repository settings (`Settings > Secrets and variables > Actions > Variables`):
42+
43+
- `MODEL_PROVIDER` - Choose: `openai`, `anthropic`, or `openrouter` (default: `anthropic`)
44+
- `MODEL_NAME` - Model to use (default: `claude-3-5-sonnet-20241022`)
45+
- `MAX_TOKENS` - Maximum tokens for responses (default: `8192`)
46+
- `TEMPERATURE` - Model temperature 0-1 (default: `0.2`)
47+
48+
### 3. Enable GitHub Actions
49+
50+
1. Go to `Settings > Actions > General`
51+
2. Under "Workflow permissions", select "Read and write permissions"
52+
3. Check "Allow GitHub Actions to create and approve pull requests"
53+
4. Save the settings
54+
55+
### 4. Test the Bot
56+
57+
Create an issue or comment with `/roo` to trigger the bot:
58+
59+
```
60+
/roo plan
61+
62+
Please help me implement a new feature for user authentication.
63+
```
64+
65+
## Workflow Triggers
66+
67+
The bot is triggered by:
68+
69+
- **Issue events**: When issues are opened or edited containing `/roo`
70+
- **Issue comments**: When comments are created or edited containing `/roo`
71+
- **Pull request events**: When PRs are opened, edited, or synchronized containing `/roo`
72+
- **PR review comments**: When review comments are created or edited containing `/roo`
73+
- **Manual dispatch**: Can be triggered manually from the Actions tab
74+
75+
## Architecture
76+
77+
```
78+
.github/
79+
├── workflows/
80+
│ └── roocode-bot.yml # GitHub Actions workflow definition
81+
└── scripts/
82+
├── roocode-agent.ts # Main bot logic
83+
├── package.json # Dependencies
84+
└── README.md # This file
85+
```
86+
87+
## Development
88+
89+
To test locally:
90+
91+
```bash
92+
cd .github/scripts
93+
npm install
94+
npm start
95+
```
96+
97+
Set environment variables:
98+
99+
```bash
100+
export GITHUB_TOKEN=your_token
101+
export ANTHROPIC_API_KEY=your_key
102+
export GITHUB_EVENT_PATH=path/to/event.json
103+
export GITHUB_REPOSITORY=owner/repo
104+
export GITHUB_EVENT_NAME=issues
105+
```
106+
107+
## Security Considerations
108+
109+
- API keys are stored as encrypted secrets
110+
- The bot only has permissions granted by the `GITHUB_TOKEN`
111+
- All actions are logged in GitHub Actions
112+
- The bot identifies itself in all comments
113+
114+
## Extending the Bot
115+
116+
To add new commands:
117+
118+
1. Add the command detection in `extractCommands()`
119+
2. Implement the handler function
120+
3. Add the case in `processIssue()` or `processPullRequest()`
121+
4. Update this README with the new command
122+
123+
## Troubleshooting
124+
125+
Check the GitHub Actions logs:
126+
127+
1. Go to the "Actions" tab in your repository
128+
2. Click on the "RooCode Agent Bot" workflow
129+
3. Select a run to view detailed logs
130+
131+
Common issues:
132+
133+
- Missing API keys: Check repository secrets
134+
- Insufficient permissions: Check workflow permissions
135+
- Model errors: Verify MODEL_PROVIDER and MODEL_NAME variables

.github/scripts/package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "roocode-agent-scripts",
3+
"version": "1.0.0",
4+
"description": "RooCode Agent GitHub Actions Bot",
5+
"type": "module",
6+
"scripts": {
7+
"start": "tsx roocode-agent.ts"
8+
},
9+
"dependencies": {
10+
"@octokit/rest": "^20.0.2",
11+
"@anthropic-ai/sdk": "^0.37.0",
12+
"openai": "^5.12.2",
13+
"@modelcontextprotocol/sdk": "^1.12.0",
14+
"tsx": "^4.19.3"
15+
},
16+
"devDependencies": {
17+
"@types/node": "^20.0.0"
18+
}
19+
}

0 commit comments

Comments
 (0)