Git Integrations

XGopilot integrates with your Git platform through webhooks and API tokens. This page covers platform-specific setup details.

Platform Overview

PlatformAuth MethodWebhook EventsSelf-Hosted
GitHubGitHub App or PATIssues, PRs, Reviews, Comments✅ Enterprise
GitLabProject/Group PAT (api scope)Comments, MR eventsSaaS & CE/EE
CNBPlatform TokenIssue/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

PermissionAccessWhy
IssuesRead & WriteAnalyze and respond to issues
Pull requestsRead & WriteCreate PRs, respond to PR comments
ContentsReadRead repository files for analysis
MetadataReadRepository 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:

  1. Check webhook delivery logs on your Git platform
  2. Verify the webhook URL is accessible from the internet
  3. Check XGopilot logs: docker logs xgopilot
  4. Ensure the webhook secret matches
Need help or a custom plan?
Talk to us for deployment guidance, enterprise support, or a tailored model setup with Qiniu AIGC.
Email: bd@qiniu.com
Phone: 400-808-9176 ext. 1
Contact Us