Integrations
GitHub Integration
Automate code reviews, issue triage, and development workflows with AI-powered GitHub integration.
Overview
The GitHub integration connects your Engrami agents to your repositories for automated code analysis, pull request reviews, issue management, and CI/CD workflows.
- Automated PR code reviews
- Issue triage and labeling
- Documentation generation
- Security vulnerability detection
- Release notes generation
Setup
1. Install GitHub App
Install the Engrami GitHub App on your repositories:
- Go to github.com/apps/engrami
- Click "Install" and select your organization
- Choose repositories to enable
- Authorize the requested permissions
2. Required Permissions
# Repository permissions
Contents: Read
Issues: Read & Write
Pull requests: Read & Write
Workflows: Read & Write
Checks: Read & Write
Metadata: Read
# Organization permissions
Members: Read3. Connect to Engrami
curl -X POST https://api.engrami.com/api/v1/integrations \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "github",
"config": {
"installation_id": "12345678",
"repositories": ["org/repo1", "org/repo2"]
},
"agent_id": "agent_code_reviewer"
}'Features
Automated Code Review
Get AI-powered code reviews on every pull request:
# .github/engrami.yml
code_review:
enabled: true
agent_id: code_reviewer
rules:
- check: security
severity: error
- check: performance
severity: warning
- check: best_practices
severity: info
auto_approve:
enabled: false
require_all_checks: trueIssue Triage
Automatically categorize and assign issues:
# Workflow configuration
issue_triage:
enabled: true
agent_id: issue_classifier
actions:
- classify_type: [bug, feature, question, documentation]
- assign_labels: true
- suggest_assignee: true
- auto_respond:
enabled: true
template: "Thanks for reporting! We'll review shortly."PR Description Generator
Auto-generate PR descriptions from commit history:
# When creating a PR, the agent generates:
## Summary
This PR implements user authentication using JWT tokens.
## Changes
- Added /auth/login endpoint
- Added /auth/register endpoint
- Implemented JWT token generation and validation
- Added middleware for protected routes
## Testing
- Unit tests added for auth service
- Integration tests for auth endpoints
## Breaking Changes
NoneSecurity Scanning
Detect vulnerabilities in code changes:
// PR Comment from agent
⚠️ **Security Review**
Found 2 potential issues:
1. **SQL Injection Risk** (Line 45)
```python
query = f"SELECT * FROM users WHERE id = {user_id}"
```
**Fix**: Use parameterized queries
2. **Sensitive Data Exposure** (Line 78)
API key hardcoded in source file
**Fix**: Use environment variablesWorkflow Integration
Trigger Engrami workflows from GitHub events:
{
"name": "PR Review Pipeline",
"nodes": [
{
"id": "trigger",
"type": "github_webhook",
"config": {
"events": ["pull_request.opened", "pull_request.synchronize"],
"repositories": ["org/main-app"]
}
},
{
"id": "review",
"type": "agent",
"config": {
"agent_id": "code_reviewer",
"context": {
"include_file_contents": true,
"max_files": 50
}
}
},
{
"id": "comment",
"type": "github_pr_comment",
"config": {
"comment_type": "review"
}
}
]
}GitHub Actions
Use Engrami in your GitHub Actions workflows:
# .github/workflows/engrami-review.yml
name: Engrami Code Review
on:
pull_request:
types: [opened, synchronize]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Engrami Review
uses: engrami/github-action@v1
with:
api-key: ${{ secrets.ENGRAMI_API_KEY }}
agent-id: code_reviewer
review-type: comprehensive
- name: Post Results
uses: engrami/post-review@v1
with:
fail-on-critical: true