Skip to main content
Configure the GitHub integration

How to configure the Stack Overflow for Teams Enterprise GitHub integration.

Joel Bradley avatar
Written by Joel Bradley
Updated over a week ago

Tags | Integrations | GitHub |

Applies to: Enterprise

ADMIN PRIVILEGES REQUIRED

This documentation is for Stack Overflow Enterprise. Free, Basic, and Business users can access their documentation here. Find your plan.


Overview

With the Stack Overflow for Teams Enterprise (SOE) GitHub integration, GitHub URLs for file blobs, gists, pull requests, and commits will unfurl in SOE questions and answers.

NOTE: Your SOE site must allow outgoing connections to GitHub over HTTPS port 443. An on-premises GitHub Enterprise server must be publicly accessible over the Internet. If it's behind a VPN or otherwise inaccessible, link unfurling will not function.

Configure GitHub

The GitHub integration requires a GitHub user to act as a bot account for the instance. You'll create a new GitHub bot user account for SOE and generate a personal access token for this user.

  1. In GitHub, create a user account for the SOE bot.

  2. Log into GitHub as the GitHub bot user (verify your email address if required).

  3. Click on the profile photo in the upper-right corner of any page, then click Settings.

  4. In the left-hand menu, click Developer settings.

  5. Click Personal access tokens, then Generate new token.

  6. On the new personal access token page, add a note describing the purpose of the token (for example: "Stack Overflow Enterprise").

  7. Check repo to give the token code repository access.

  8. Click Generate Token.

  9. If your organization requires SSO to authenticate into GitHub, you'll need to authorize the token.

    • In GitHub, click Configure SSO next to SOE user token you just created.

    • In the dropdown menu, locate your organization and click Authorize.

  10. On the personal access tokens screen, copy the token. You won’t be able to see the token again after you leave this page. If you leave the page before copying the token, you'll need to create a new one.

Configure SOE

You'll complete the GitHub configuration in SOE. The process will differ slightly depending on whether you're using GitHub or GitHub Enterprise.

  1. After logging into SOE as an administrator, click Admin settings in the left-hand menu. Click GitHub under the "INTEGRATIONS AND APPS" heading.

  2. Click the On toggle corresponding to the type of GitHub integration you're using (GitHub or GitHub Enterprise). GitHub Enterprise is pictured below.

  3. Paste the token you created in Github into the appropriate ...access token box.

  4. If using GitHub Enterprise:

    • Enter your GitHub Enteprise base URL. This will be the URL of your instance (if self-hosted) or https://github.com (if GitHub-hosted).

    • If you use subdomain isolation on your GitHub Enterprise instance, set Enable Sub Domain Isolation to Yes.

  5. Click Save settings.

The GitHub integration should now be active, showing previews of new GitHub URLs for file blobs, gists, pull requests, and commits in questions and answers. GitHub links in existing questions or answers will not be previewed until someone edits the post.

NOTE: SOE will only preview GitHub URLS that appear on their own line in the question or answer.

Did this answer your question?