Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 142 additions & 0 deletions github-actions-workflows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# GitHub Actions Workflows for RooCode Agent Bot

Due to GitHub security restrictions, workflow files cannot be automatically created via GitHub Apps. Please manually add these files to your repository.

## Required Files

### 1. `.github/workflows/roocode-bot.yml`

```yaml
name: RooCode Agent Bot

on:
issues:
types: [opened, edited]
issue_comment:
types: [created, edited]
pull_request:
types: [opened, edited, synchronize]
pull_request_review_comment:
types: [created, edited]
workflow_dispatch:
inputs:
issue_number:
description: "Issue number to process"
required: false
type: string
pr_number:
description: "PR number to process"
required: false
type: string

jobs:
process-event:
runs-on: ubuntu-latest
if: |
(github.event_name == 'issues' && contains(github.event.issue.body, '/roo')) ||
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '/roo')) ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.body, '/roo')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '/roo')) ||
github.event_name == 'workflow_dispatch'

permissions:
contents: write
issues: write
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
run: |
cd .github/scripts
npm install

- name: Process Event
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
MODEL_PROVIDER: ${{ vars.MODEL_PROVIDER || 'anthropic' }}
MODEL_NAME: ${{ vars.MODEL_NAME || 'claude-3-5-sonnet-20241022' }}
MAX_TOKENS: ${{ vars.MAX_TOKENS || '8192' }}
TEMPERATURE: ${{ vars.TEMPERATURE || '0.2' }}
run: |
cd .github/scripts
npm start
```

### 2. `.github/scripts/package.json`

```json
{
"name": "roocode-agent-scripts",
"version": "1.0.0",
"description": "RooCode Agent GitHub Actions Bot",
"type": "module",
"scripts": {
"start": "tsx roocode-agent.ts"
},
"dependencies": {
"@octokit/rest": "^20.0.2",
"@anthropic-ai/sdk": "^0.37.0",
"openai": "^5.12.2",
"@modelcontextprotocol/sdk": "^1.12.0",
"tsx": "^4.19.3"
},
"devDependencies": {
"@types/node": "^20.0.0"
}
}
```

### 3. `.github/scripts/roocode-agent.ts`

Create this file with the full agent implementation. The complete code is available in the PR description.

### 4. `.github/scripts/README.md`

Documentation for the GitHub Actions bot setup and usage.

## Setup Instructions

1. **Add the workflow files manually** to your repository
2. **Configure Repository Secrets** (Settings → Secrets and variables → Actions):

- `ANTHROPIC_API_KEY` or `OPENAI_API_KEY` (at least one required)
- `OPENROUTER_API_KEY` (optional)

3. **Configure Repository Variables** (Settings → Secrets and variables → Actions → Variables):

- `MODEL_PROVIDER`: `anthropic`, `openai`, or `openrouter`
- `MODEL_NAME`: Model identifier
- `MAX_TOKENS`: Maximum response tokens
- `TEMPERATURE`: Model temperature (0-1)

4. **Enable GitHub Actions Permissions**:
- Go to Settings → Actions → General
- Select "Read and write permissions"
- Check "Allow GitHub Actions to create and approve pull requests"

## Available Commands

- `/roo plan` - Create implementation plan
- `/roo approve` - Approve plan and implement
- `/roo fix` - Direct fix implementation
- `/roo review` - Review pull request
- `/roo triage` - Triage issue
- `/roo label` - Add labels to issue
- `/roo` - General bot interaction

## Testing

Create an issue or PR comment with `/roo` to trigger the bot.
1 change: 1 addition & 0 deletions packages/types/src/vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const commandIds = [
"mcpButtonClicked",
"historyButtonClicked",
"marketplaceButtonClicked",
"githubActionsButtonClicked",
"popoutButtonClicked",
"cloudButtonClicked",
"settingsButtonClicked",
Expand Down
8 changes: 8 additions & 0 deletions src/activate/registerCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
if (!visibleProvider) return
visibleProvider.postMessageToWebview({ type: "action", action: "marketplaceButtonClicked" })
},
githubActionsButtonClicked: () => {
const visibleProvider = getVisibleProviderOrLog(outputChannel)
if (!visibleProvider) return

TelemetryService.instance.captureTitleButtonClicked("githubActions")

visibleProvider.postMessageToWebview({ type: "action", action: "githubActionsButtonClicked" })
},
showHumanRelayDialog: (params: { requestId: string; promptText: string }) => {
const panel = getPanel()

Expand Down
49 changes: 47 additions & 2 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@
"title": "%command.marketplace.title%",
"icon": "$(extensions)"
},
{
"command": "roo-cline.githubActionsButtonClicked",
"title": "%command.githubActions.title%",
"icon": "$(github-action)"
},
{
"command": "roo-cline.popoutButtonClicked",
"title": "%command.openInEditor.title%",
Expand Down Expand Up @@ -229,15 +234,20 @@
"when": "view == roo-cline.SidebarProvider"
},
{
"command": "roo-cline.settingsButtonClicked",
"command": "roo-cline.githubActionsButtonClicked",
"group": "navigation@3",
"when": "view == roo-cline.SidebarProvider"
},
{
"command": "roo-cline.cloudButtonClicked",
"command": "roo-cline.settingsButtonClicked",
"group": "navigation@4",
"when": "view == roo-cline.SidebarProvider"
},
{
"command": "roo-cline.cloudButtonClicked",
"group": "navigation@5",
"when": "view == roo-cline.SidebarProvider"
},
{
"command": "roo-cline.historyButtonClicked",
"group": "overflow@1",
Expand Down Expand Up @@ -417,6 +427,41 @@
"minimum": 1,
"maximum": 200,
"description": "%settings.codeIndex.embeddingBatchSize.description%"
},
"roo-cline.githubActions.enabled": {
"type": "boolean",
"default": false,
"description": "%settings.githubActions.enabled.description%"
},
"roo-cline.githubActions.workflowsPath": {
"type": "string",
"default": ".github/workflows",
"description": "%settings.githubActions.workflowsPath.description%"
},
"roo-cline.githubActions.autoInstall": {
"type": "boolean",
"default": false,
"description": "%settings.githubActions.autoInstall.description%"
},
"roo-cline.githubActions.defaultBranch": {
"type": "string",
"default": "main",
"description": "%settings.githubActions.defaultBranch.description%"
},
"roo-cline.githubActions.modelProvider": {
"type": "string",
"enum": [
"anthropic",
"openai",
"openrouter"
],
"default": "anthropic",
"description": "%settings.githubActions.modelProvider.description%"
},
"roo-cline.githubActions.modelName": {
"type": "string",
"default": "claude-3-5-sonnet-20241022",
"description": "%settings.githubActions.modelName.description%"
}
}
}
Expand Down
9 changes: 8 additions & 1 deletion src/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"command.prompts.title": "Modes",
"command.history.title": "History",
"command.marketplace.title": "Marketplace",
"command.githubActions.title": "GitHub Actions",
"command.openInEditor.title": "Open in Editor",
"command.cloud.title": "Cloud",
"command.settings.title": "Settings",
Expand Down Expand Up @@ -41,5 +42,11 @@
"settings.useAgentRules.description": "Enable loading of AGENTS.md files for agent-specific rules (see https://agent-rules.org/)",
"settings.apiRequestTimeout.description": "Maximum time in seconds to wait for API responses (0 = no timeout, 1-3600s, default: 600s). Higher values are recommended for local providers like LM Studio and Ollama that may need more processing time.",
"settings.newTaskRequireTodos.description": "Require todos parameter when creating new tasks with the new_task tool",
"settings.codeIndex.embeddingBatchSize.description": "The batch size for embedding operations during code indexing. Adjust this based on your API provider's limits. Default is 60."
"settings.codeIndex.embeddingBatchSize.description": "The batch size for embedding operations during code indexing. Adjust this based on your API provider's limits. Default is 60.",
"settings.githubActions.enabled.description": "Enable GitHub Actions bot integration",
"settings.githubActions.workflowsPath.description": "Path to GitHub Actions workflows directory",
"settings.githubActions.autoInstall.description": "Automatically install recommended workflows",
"settings.githubActions.defaultBranch.description": "Default branch for GitHub Actions operations",
"settings.githubActions.modelProvider.description": "AI model provider for GitHub Actions bot",
"settings.githubActions.modelName.description": "AI model name for GitHub Actions bot"
}
Loading
Loading