GitHub Integration
Connect GitHub to enable the AI agent to access code context, pull requests, and deployment information during investigations.
Capabilities
Once connected, the AI agent can:
| Capability | Description |
|---|---|
| Browse Code | View repository files and code |
| Search Code | Search across repositories |
| Pull Requests | Review recent PRs and changes |
| Commits | View commit history and diffs |
| Deployments | Check deployment status |
| Actions | Review workflow runs |
Prerequisites
- A GitHub account or organization
- A Personal Access Token (PAT) or GitHub App
- Read access to the repositories you want to query
Setup
1
Create a Personal Access Token
- Go to GitHub Settings → Developer settings → Personal access tokens → Fine-grained tokens
- Click Generate new token
- Set an expiration date
- Select the repositories to grant access
- Set permissions (see below)
- Generate and copy the token
2
Add Integration in Autoheal
- Go to Integrations in Autoheal
- Click GitHub
- Enter a name (e.g., "Production GitHub")
3
Configure Credentials
Enter the following:
- Token: Your GitHub Personal Access Token
- Organization (optional): Limit to a specific org
4
Test and Save
Click Test Connection to verify, then Save.
Required Permissions
For fine-grained tokens, grant these permissions:
| Permission | Access Level | Why It's Needed |
|---|---|---|
| Contents | Read | View repository files |
| Metadata | Read | Access repository information |
| Pull requests | Read | View PR details |
| Commit statuses | Read | Check CI/CD status |
| Actions | Read | View workflow runs |
| Deployments | Read | Check deployment status |
tip
Use fine-grained tokens when possible - they provide more granular control than classic tokens.
GitHub Enterprise
For GitHub Enterprise Server, provide the API URL:
https://github.your-company.com/api/v3
Example Queries
Once connected, you can ask the AI agent:
What changed in the last deployment to production?
Show me recent commits to the payment service
Were there any PRs merged today that touched the database code?
What's the status of the CI pipeline?
Troubleshooting
401 Unauthorized
- Verify the token is correct and hasn't expired
- Check that the token has access to the requested repositories
- For fine-grained tokens, ensure the correct organization is selected
404 Not Found
- Verify the repository exists and the token has access
- Check the organization/owner name is correct
- Ensure the repository isn't private without proper token access
Rate Limited
- GitHub has API rate limits (5,000 requests/hour for authenticated requests)
- Consider using a GitHub App for higher limits
- Wait for the rate limit to reset