🤖 Automated GitHub issue analysis using AI-powered code analysis. This action automatically analyzes GitHub issues when they are created or updated, providing intelligent insights and recommendations.
- 🔍 Intelligent Issue Analysis: AI-powered analysis of GitHub issues with code context
- 💬 Automated Comments: Automatically add analysis results as comments to issues
- 🏷️ Smart Labeling: Automatically apply relevant labels based on analysis
- 🌐 Webhook Support: Standalone webhook server for real-time issue processing
- ⚙️ Configurable: Flexible configuration options for different workflows
- 🔗 Integration Ready: Built on top of the proven AutoDev GitHub Agent
- 🔍 Process Transparency: Detailed analysis process information and file filtering insights
- 🛠️ Diagnostic Information: Clear explanations when analysis results are limited
- 🍽️ Dogfooding: We use our own action to analyze issues in this repository!
Before using this action, you need:
- A GitHub repository
- An API key from one of the supported LLM providers (OpenAI, DeepSeek, or GLM)
-
Add API Key Secret:
- Go to your repository's Settings → Secrets and variables → Actions
- Click New repository secret
- Add
DEEPSEEK_TOKEN
(orOPENAI_API_KEY
/GLM_TOKEN
) with your API key
-
Create Workflow File:
- Create
.github/workflows/issue-analysis.yml
in your repository
- Create
-
Configure the Action:
- Use the configuration examples below
Add this action to your workflow file (e.g., .github/workflows/issue-analysis.yml
):
name: Analyze Issues
on:
issues:
types: [opened, edited, reopened]
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Analyze Issue
uses: unit-mesh/autodev-remote-agent-action@v0.3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
deepseek-token: ${{ secrets.DEEPSEEK_TOKEN }} # or use openai-api-key/glm-token
analysis-depth: medium
auto-comment: true
auto-label: true
# Install dependencies
npm install
# Set environment variables
export GITHUB_TOKEN="your-github-token"
export WEBHOOK_SECRET="your-webhook-secret"
export DEEPSEEK_TOKEN="your-deepseek-token" # or OPENAI_API_KEY/GLM_TOKEN
# Start the server
npx autodev-github-action server --port 3000
# Analyze a specific issue
npx autodev-github-action analyze \
--owner unit-mesh \
--repo autodev-workbench \
--issue 81 \
--depth deep
# Start webhook server
npx autodev-github-action server --port 3000
# Validate configuration
npx autodev-github-action validate
Input | Description | Default | Required |
---|---|---|---|
github-token |
GitHub token for API access | ${{ github.token }} |
Yes |
deepseek-token |
DeepSeek API token for LLM analysis | `` | No* |
openai-api-key |
OpenAI API key for LLM analysis | `` | No* |
glm-token |
GLM API token for LLM analysis | `` | No* |
workspace-path |
Path to repository workspace | ${{ github.workspace }} |
No |
analysis-depth |
Analysis depth (shallow/medium/deep) | medium |
No |
auto-comment |
Add analysis comment to issues | true |
No |
auto-label |
Add labels based on analysis | true |
No |
trigger-events |
Events that trigger analysis | opened,edited,reopened |
No |
exclude-labels |
Labels to exclude from analysis | `` | No |
include-labels |
Labels to include for analysis | `` | No |
include-config-files |
Include configuration files in analysis | true |
No |
include-test-files |
Include test files in analysis | true |
No |
include-patterns |
File patterns to force include | `` | No |
exclude-patterns |
File patterns to exclude | `` | No |
force-include-files |
Specific files to always include | `` | No |
webhook-secret |
Secret for webhook verification | `` | No |
*At least one LLM API key is required for AI analysis
Variable | Description | Default |
---|---|---|
GITHUB_TOKEN |
GitHub personal access token | Required |
DEEPSEEK_TOKEN |
DeepSeek API token for LLM analysis | Optional* |
OPENAI_API_KEY |
OpenAI API key for LLM analysis | Optional* |
GLM_TOKEN |
GLM API token for LLM analysis | Optional* |
WEBHOOK_SECRET |
Secret for webhook verification | Optional |
WORKSPACE_PATH |
Repository workspace path | process.cwd() |
AUTO_COMMENT |
Auto-add comments | true |
AUTO_LABEL |
Auto-add labels | true |
ANALYSIS_DEPTH |
Analysis depth | medium |
TRIGGER_EVENTS |
Trigger events | opened,edited,reopened |
EXCLUDE_LABELS |
Exclude labels | `` |
INCLUDE_LABELS |
Include labels | `` |
*At least one LLM API key is required for AI analysis
This action supports multiple LLM providers. You need to configure at least one API key:
- uses: unit-mesh/autodev-remote-agent-action@v0.3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
deepseek-token: ${{ secrets.DEEPSEEK_TOKEN }}
- uses: unit-mesh/autodev-remote-agent-action@v0.3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
- uses: unit-mesh/autodev-remote-agent-action@v0.3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
glm-token: ${{ secrets.GLM_TOKEN }}
- Go to your repository's Settings → Secrets and variables → Actions
- Click New repository secret
- Add one of the following secrets:
DEEPSEEK_TOKEN
: Your DeepSeek API token from DeepSeek PlatformOPENAI_API_KEY
: Your OpenAI API key from OpenAI PlatformGLM_TOKEN
: Your GLM API token from GLM Platform
- Quick analysis focusing on obvious patterns
- Fast execution (< 30 seconds)
- Basic code references
- Suitable for high-volume repositories
- Balanced analysis with meaningful insights
- Moderate execution time (30-60 seconds)
- Comprehensive code exploration
- Good for most use cases
- In-depth analysis including dependencies
- Longer execution time (60-120 seconds)
- Architectural pattern analysis
- Best for complex issues
- name: Analyze Issues
uses: unit-mesh/autodev-remote-agent-action@v0.3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
deepseek-token: ${{ secrets.DEEPSEEK_TOKEN }}
- name: Advanced Issue Analysis
uses: unit-mesh/autodev-remote-agent-action@v0.3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
deepseek-token: ${{ secrets.DEEPSEEK_TOKEN }}
analysis-depth: deep
auto-comment: true
auto-label: true
exclude-labels: 'wontfix,duplicate'
include-labels: 'bug,enhancement'
Control which files are included in the analysis:
- name: Custom File Filtering
uses: unit-mesh/autodev-remote-agent-action@v0.3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
deepseek-token: ${{ secrets.DEEPSEEK_TOKEN }}
# File inclusion settings
include-config-files: true # Include jest.config.js, rollup.config.mjs, etc.
include-test-files: true # Include __tests__/, *.test.js, etc.
# Custom patterns (comma-separated)
include-patterns: "*.config.js,*.config.ts,docker-compose.yml"
exclude-patterns: "*.min.js,*.bundle.js"
force-include-files: "important-config.js,critical-setup.ts"
The action now provides detailed process information in comments:
- name: Analysis with Full Transparency
uses: unit-mesh/autodev-remote-agent-action@v0.3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
deepseek-token: ${{ secrets.DEEPSEEK_TOKEN }}
auto-comment: true # Comments will include process details
analysis-depth: medium
What you'll see in analysis comments:
- 📊 Process Summary: Files scanned vs. analyzed vs. filtered
⚠️ Filtered Files: Specific files that were excluded and why- 🔄 Analysis Steps: Each step's success/failure with timing
- 🧠 LLM Calls: AI service calls and any errors
- 💡 Improvement Suggestions: How to get better analysis results
const { startWebhookServer } = require('@autodev/remote-agent-action');
const server = await startWebhookServer({
port: 3000,
webhookSecret: process.env.WEBHOOK_SECRET,
githubToken: process.env.GITHUB_TOKEN
});
Main service class for processing issues.
const service = new GitHubActionService({
githubToken: 'your-token',
workspacePath: '/path/to/repo',
autoComment: true,
autoLabel: true
});
const result = await service.processIssue({
owner: 'unit-mesh',
repo: 'autodev-workbench',
issueNumber: 81
});
Core analysis engine.
const analyzer = new IssueAnalyzer(context);
const result = await analyzer.analyzeIssue({
depth: 'medium',
includeCodeSearch: true,
includeSymbolAnalysis: true
});
Webhook server for real-time processing.
const handler = new WebhookHandler(actionService, {
port: 3000,
secret: 'webhook-secret',
onIssueOpened: async (payload) => {
console.log('Issue opened:', payload.issue.number);
}
});
await handler.start();
# Clone the repository
git clone https://github.com/unit-mesh/autodev-remote-agent-action.git
cd autodev-remote-agent-action
# Install dependencies (using pnpm for better dependency management)
pnpm install
# or use npm
npm install
# Build the package
npm run build
# Run tests
npm test
# Test locally
node dist/index.js --help
# Clean build (removes dist/ and rebuilds)
npm run build:clean
# Development build with watch mode
npm run dev
# Lint code
npm run lint
# Test locally
node dist/index.js --help
autodev-remote-agent-action/
├── src/ # Source code (TypeScript)
│ ├── action.ts # Main action service
│ ├── issue-analyzer.ts # Issue analysis logic
│ ├── webhook-handler.ts # Webhook server
│ ├── types/ # Type definitions
│ └── index.ts # Main entry point
├── dist/ # Build output (committed to git)
├── bin/
│ └── action.js # CLI entry point
├── action.yml # GitHub Action definition
├── package.json
└── README.md
- Make your changes and test locally
- Run
npm run build:clean
to ensure clean build - Test the built action:
node dist/index.js
- Update version in
package.json
- Commit all changes including
dist/
files - Create a git tag:
git tag v0.3.3 && git push origin v0.3.3
- The new version will be available for use in GitHub Actions
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
MIT License - see LICENSE for details.
- AutoDev GitHub Agent - Core analysis engine
- AutoDev Context Worker - Code context analysis
- AutoDev Worker Core - Core utilities