Skip to content

GitHub Integration

GuideMode integrates with GitHub to provide comprehensive visibility into your development workflow. This integration enables organization sync, pull request tracking, issue management, and deployment analytics for DORA metrics.

  • Organization & Team Sync: Automatically sync your GitHub organization members and teams to GuideMode
  • Pull Request Tracking: Link AI coding sessions to pull requests for end-to-end traceability
  • Issue Tracking: Monitor issues and their lifecycle through your workflow
  • Deployment Tracking: Capture deployment events for DORA metrics (lead time, deployment frequency)
  • Label Mapping: Map your GitHub labels to GuideMode’s analytical categories

Before setting up the GitHub integration, you’ll need:

  • A GitHub account with admin access to your organization (for org sync)
  • Access to create OAuth Apps and GitHub Apps in GitHub Developer Settings
  • Admin permissions in your GuideMode tenant

The GitHub integration uses two components:

  1. GitHub OAuth App - For user authentication (logging in with GitHub)
  2. GitHub App - For organization sync, webhooks, and repository access

The OAuth App handles user authentication when users log in with GitHub.

  1. Go to GitHub Settings > Developer settings > OAuth Apps
  2. Click New OAuth App
  3. Fill in the details:
    • Application name: GuideMode (or your preferred name)
    • Homepage URL: https://guidemode.dev (or your deployment URL)
    • Authorization callback URL: https://guidemode.dev/auth/github/callback
  4. Click Register application
  5. Copy the Client ID
  6. Click Generate a new client secret and copy the secret

The GitHub App enables team sync, webhooks, and repository access.

  1. Go to GitHub Settings > Developer settings > GitHub Apps
  2. Click New GitHub App
  3. Fill in the basic details:
    • GitHub App name: guidemode (must be unique across GitHub)
    • Homepage URL: https://guidemode.dev
  1. Enable webhooks and set:
    • Webhook URL: https://guidemode.dev/api/github/webhook
    • Webhook secret: Generate a secure random string and save it
  1. Configure Repository permissions:

    • Issues: Read-only
    • Pull requests: Read-only
    • Deployments: Read-only
    • Contents: Read-only (for repository metadata)
  2. Configure Organization permissions:

    • Members: Read-only
    • Administration: Read-only (for team structure)
  1. Under Subscribe to events, enable:
    • Issues
    • Pull request
    • Pull request review
    • Deployment
    • Deployment status
    • Member
    • Membership
    • Team
    • Repository
  1. Click Create GitHub App
  2. On the app page, click Generate a private key
  3. Download and securely store the .pem file
  4. Copy the App ID from the app settings page

Add these environment variables to your GuideMode deployment:

Terminal window
GITHUB_CLIENT_ID=your_oauth_client_id
GITHUB_CLIENT_SECRET=your_oauth_client_secret
Terminal window
GITHUB_APP_ID=123456
GITHUB_APP_NAME=guidemode
GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----
...your private key contents...
-----END RSA PRIVATE KEY-----"
GITHUB_APP_WEBHOOK_SECRET=your_webhook_secret

For local development, add these to your .dev.vars file in the server app.

Once your GuideMode instance is configured:

  1. Navigate to Settings > GitHub in GuideMode
  2. Click Install GitHub App
  3. Choose your organization or personal account
  4. Select which repositories to grant access to:
    • All repositories: Recommended for full visibility
    • Selected repositories: For limited access
  5. Click Install to complete

GitHub Settings

After installing the GitHub App, you can sync your organization:

  • Members: All organization members are created as users in GuideMode
  • Teams: GitHub teams are mirrored to GuideMode teams
  • Team memberships: Member roles (member/maintainer) are preserved
  • Repository links: Team repositories are linked to GuideMode projects
  1. Go to Settings > GitHub
  2. Click Sync Organization
  3. Wait for the sync to complete (status shows progress)

Syncs run automatically when:

  • A new member joins the organization
  • Team memberships change
  • Teams are created or modified

When a pull request is opened in a repository where GuideMode has detected a coding session, the integration adds context to the PR:

GitHub PR Integration

This provides end-to-end traceability from AI session through to deployed code.

Requirements:

  • Session data must be synced (at least Metrics Only mode)
  • For full auditability, enable Full Transcript sync

GuideMode maps GitHub labels to internal issue types for analytics. This enables consistent reporting across different projects that may use different labeling conventions.

GuideMode classifies issues into these categories:

TypeDescription
featureNew functionality or enhancements
bugDefects, fixes, regressions
choreMaintenance, refactoring, tech debt
discoveryResearch, spikes, investigations
incidentProduction issues, outages, emergencies
otherUncategorized issues

When no custom mappings are configured, GuideMode uses these heuristics (case-insensitive, partial matching):

Bug: Labels containing bug, defect, fix, regression

Feature: Labels containing feature, enhancement, improvement, story

Chore: Labels containing chore, refactor, tech-debt, maintenance, cleanup

Discovery: Labels containing spike, research, investigation, discovery, exploration

Incident: Labels containing incident, outage, critical, emergency, or matching p0, p1, sev0, sev1

You can configure custom mappings per project or globally for your tenant. Custom mappings take priority over default heuristics.

Priority Order:

  1. Project-specific mappings (highest)
  2. Global tenant mappings
  3. Default heuristics (lowest)

To configure custom mappings, use the GuideMode API or contact support.

The GitHub App receives real-time updates via webhooks:

EventActionsWhat’s Captured
issuesopened, edited, closed, reopened, labeled, unlabeledIssue lifecycle and type changes
pull_requestopened, synchronize, reopened, closed, editedPR lifecycle, additions/deletions
pull_request_reviewsubmitted, edited, dismissedReview feedback
deploymentcreatedDeployment events for DORA metrics
deployment_statuscreatedSuccess/failure status
memberadded, removedOrganization membership
membershipadded, removedTeam membership changes
teamcreated, deleted, editedTeam lifecycle
repositorycreated, deleted, archivedRepository changes
installationcreated, deleted, suspendedApp installation status

Deployment events power DORA metrics calculations:

  • Deployment Frequency: How often you deploy to production
  • Lead Time for Changes: Time from commit to production
  • Change Failure Rate: Percentage of deployments causing issues
  • Time to Restore: How quickly you recover from failures

Each project can be configured for what to sync:

SettingDescription
syncIssuesEnable/disable issue tracking
syncPullRequestsEnable/disable PR tracking
syncDeploymentsEnable/disable deployment tracking

Configure these in the project settings within GuideMode.

  • Verify GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET are correct
  • Check the callback URL matches exactly: {APP_URL}/auth/github/callback
  • Ensure the OAuth App is not suspended
  • Verify webhook URL is accessible from GitHub
  • Check the webhook secret matches GITHUB_APP_WEBHOOK_SECRET
  • Review webhook delivery history in GitHub App settings
  • Ensure the app has the required event subscriptions
  • Verify the GitHub App is installed on the organization
  • Check the private key is correctly formatted (PEM format with newlines)
  • Ensure the app has Members: Read-only organization permission
  • Review sync logs in GuideMode for specific errors
  • Confirm the app has Administration: Read-only permission
  • Trigger a manual sync from Settings
  • Check that teams exist in the GitHub organization
  • Review your custom mappings (project-specific take priority)
  • Check that label names match (case-insensitive)
  • Use default heuristics as a guide for naming labels