Skip to content

GitHub Enterprise Setup#

This guide walks through connecting MergeMonkey to a self-hosted GitHub Enterprise Server (GHES) instance. The flow is a one-time registration: you create an OAuth App and a GitHub App on your GHES instance, then paste the credentials into MergeMonkey's self-managed onboarding form. After that, any user on your instance can sign in normally.

For github.com see GitHub Cloud.

Integration overview#

Registering your instance sets up four moving parts:

Before you begin

Make sure you have administrative access to your GHES instance (for creating an OAuth App and a GitHub App), and confirm that our ingress at https://app.mergemonkey.dev/webhooks/github is reachable from your network. If you're behind a strict firewall, allowlist MergeMonkey's outbound IPs.

Step 1 — Start the self-managed flow#

  1. Open the MergeMonkey login page and pick Self-Managed

    Visit mergemonkey.dev/auth/login and click Continue with GitHub. Pick Self-Managed from the Cloud / Self-Managed choice that appears.

    MergeMonkey login — pick Self-Managed

  2. Enter your instance URL

    Enter the URL of your GitHub Enterprise Server (for example https://github.example.com) and click Continue. MergeMonkey checks whether your organization has already been registered.

    GitHub Enterprise — enter instance URL

  3. See the registration form

    If your instance is new to MergeMonkey, you'll land on the registration screen with two sections — OAuth App and GitHub App. Leave this tab open; you'll switch between it and your GHES admin UI for the next two steps.

Step 2 — Create the OAuth App#

The OAuth App authenticates MergeMonkey users against your GHES instance.

  1. Open OAuth Apps on GHES

    In GitHub Enterprise: Settings → Developer settings → OAuth Apps → New OAuth App.

  2. Fill in the application details

    Use these values:

    FieldValue
    Application nameMergeMonkey
    Homepage URLhttps://mergemonkey.dev
    Authorization callback URLhttps://mergemonkey.dev/auth/callback
    Callback URL must match exactly

    The OAuth spec rejects mismatched redirect URIs, including differences in trailing slashes or http vs https. Copy the callback URL straight from the MergeMonkey registration form.

  3. Register and grab the credentials

    Click Register application. GHES shows the Client ID immediately; click Generate a new client secret and copy the Client Secret (displayed only once).

    OAuth App — Client ID and Secret

  4. Paste into MergeMonkey

    Return to the MergeMonkey registration tab and paste the Client ID and Client Secret into the OAuth App section.

Step 3 — Create the GitHub App#

The GitHub App is what reads code and posts review comments on pull requests.

  1. Open GitHub Apps on GHES

    Settings → Developer settings → GitHub Apps → New GitHub App.

  2. Configure basic settings

    FieldValue
    GitHub App nameMergeMonkey (must be unique on your instance)
    Homepage URLhttps://mergemonkey.dev
    Webhook URLhttps://app.mergemonkey.dev/webhooks/github
    Webhook secretGenerate a strong random string and save it
    Request user authorization (OAuth) during installationUnchecked
    Where can this GitHub App be installed?Any account
  3. Set repository permissions

    Under Repository permissions:

    • Pull requests — Read & write
    • Contents — Read only
    • Checks — Read & write
    • Commit statuses — Read & write
    • Issues — Read & write
    • Metadata — Read only (automatic)
  4. Subscribe to events

    Under Subscribe to events check:

    • Pull request
    • Pull request review
    • Pull request review comment
    • Pull request review thread
    • Issue comment
    • Issues
  5. Create the app and collect credentials

    Click Create GitHub App. From the app's settings page:

    1. Note the App ID (top of the page).
    2. Note the Client ID.
    3. Click Generate a new client secret, copy it.
    4. Scroll to Private keys → Generate a private key. A PEM file downloads automatically — keep it handy.
    Secrets are shown once

    The client secret is visible right after generation only. The private key PEM cannot be retrieved later — if you lose it, generate a new one.

  6. Paste into MergeMonkey

    On the MergeMonkey registration tab fill the GitHub App section:

    CredentialWhere to find itNotes
    App IDGitHub App settings → top of the page—
    Client IDGitHub App settings → About—
    Client SecretGenerated in the previous sub-step—
    Webhook SecretThe string you entered in Step 3.2—
    Private Key (PEM)Downloaded .pem filePaste the full contents, including BEGIN/END lines.

Step 4 — Submit and install#

  1. Submit the registration form

    Click Continue at the bottom of the MergeMonkey form. We validate the credentials by making a test API call to your instance and, on success, store them (encrypted at rest).

  2. Install the GitHub App on your organization

    After validation, MergeMonkey redirects you to your GitHub App's install page on GHES. Pick the organization, choose All repositories or a specific subset, and confirm.

  3. Open a pull request

    Push a test commit or open any existing PR. A review comment from mergemonkeyhq should appear within ~60 seconds.

Networking checklist#

Both directions must be reachable

MergeMonkey calls your GHES API (outbound from our worker) and GHES must deliver webhooks to our ingress (inbound to your firewall). If either leg is blocked, reviews won't run.

  • Outbound from MergeMonkey worker → your GHES API (HTTPS 443).
  • Inbound from GHES → https://app.mergemonkey.dev/webhooks/github.
  • If your GHES instance lives behind a VPN with no public egress, contact us — we can run a MergeMonkey worker inside your network.

Troubleshooting#

"Your organization is not registered with us"#

Expected on the first attempt for a new instance. Complete Step 2 + Step 3 to register. Subsequent users on the same instance skip registration entirely.

Webhook deliveries fail with 401 or 403#

The Webhook Secret in MergeMonkey must match the one you entered when creating the GitHub App. If they diverge, every delivery is rejected. Fix: regenerate the secret on GHES and update the value in MergeMonkey via /platform/settings/installations.

Reviews never appear#

Check webhook delivery logs: GHES → your org → Settings → GitHub Apps → MergeMonkey → Advanced → Recent Deliveries. A red X with a connection error means our ingress is unreachable from GHES. An HTTP 401 or 403 means a signature mismatch. A green check but no review means the job is queued but the worker is throttled or at quota.

"Bad credentials" when MergeMonkey validates the form#

One of the credentials is wrong. Most common cause: pasting a truncated PEM (missing the -----BEGIN RSA PRIVATE KEY----- or end line). Open the downloaded PEM file in a plain-text editor and paste the whole thing.

Next#