Git Integrations
XGopilot integrates with your Git platform through webhooks and API tokens. This page covers platform-specific setup details.
Platform Overview
| Platform | Auth Method | Webhook Events | Self-Hosted |
|---|---|---|---|
| GitHub | GitHub App or PAT | Issues, PRs, Reviews, Comments | ✅ Enterprise |
| GitLab | Project/Group PAT (api scope) | Comments, MR events | SaaS & CE/EE |
| CNB | Platform Token | Issue/MR comments | ✅ |
GitHub Setup
GitHub App (Recommended)
Install the XGopilot GitHub App for the easiest setup. The app handles permissions and webhook configuration automatically.
GitHub App — Self-Hosted
If you're running XGopilot on your own infrastructure, create a GitHub App manually:
Required Permissions
| Permission | Access | Why |
|---|---|---|
| Issues | Read & Write | Analyze and respond to issues |
| Pull requests | Read & Write | Create PRs, respond to PR comments |
| Contents | Read | Read repository files for analysis |
| Metadata | Read | Repository information |
Required Events
- Issues, Issue comments
- Pull requests, PR reviews, PR review comments
Webhook URL
https://your-xgopilot-domain.com/hook
Configure the webhook secret to match your WEBHOOK_SECRET environment variable.
GitLab Setup
1. Create a Bot Account
Create a dedicated user (e.g., xgopilot-bot) and add it to your project/group with Developer or Maintainer role.
2. Generate a Personal Access Token
Create a PAT with api scope. Set it as the GITLAB_TOKEN environment variable.
3. Configure Webhook
In your project or group settings → Webhooks:
- URL:
https://your-xgopilot-domain.com/hook - Triggers: Comments, Merge Request events
- Secret Token: Your
WEBHOOK_SECRET
Self-Hosted GitLab
For GitLab CE/EE, set the base_url in your configuration:
platforms:
gitlab:
instances:
company:
base_url: "https://gitlab.your-company.com"
token_env: "GITLAB_TOKEN"
CNB Setup
Configure webhooks for Issue and MR comment events. Use the platform token as your authentication credential.
Verifying the Integration
After setup, create a test issue and comment:
@xgopilot hello
XGopilot should respond within a few seconds. If it doesn't:
- Check webhook delivery logs on your Git platform
- Verify the webhook URL is accessible from the internet
- Check XGopilot logs:
docker logs xgopilot - Ensure the webhook secret matches