GitHub Integration Guide
Last updated Oct 8th, 2024
Overview
By integrating GitHub with Common Room you can see contributors, comments, pull requests, repo stars, repo forks, issues, discussions, and top programming languages for members of your community. Common Room creates a profile for every contributor in your GitHub community and an activity for each issue, pull request, comment, or starred repo.
Setup
Before integrating GitHub, login to the GitHub account you want to integrate into Common Room. Once you're logged in, open the signals page in Common Room, and select GitHub.
- Select GitHub from the list of signals.
- Connect GitHub. When you connect GitHub, Common Room will surface activity and insights across pull requests, issues, contributors, starred repos, and comments.
- Authenticate your GitHub and select repos. Select "I have admin access or approval". The GitHub integration with Common Room requires admin access or approval. If you don't have admin access to your GitHub account, an email request will be sent to your admin to approve the integration.
- Install and authorize Common Room. When you install and authorize Common Room to access your GitHub repository, you can select between some or all of your public repos.
If you select to grant Common Room access to "all repos," Common Room will automatically begin tracking all current and future public repos. If you choose "some repos," you will need to manually select the public repos you'd like tracked. If you wanted to have a new public repo tracked in the future, you'd need to add this in your GitHub signal settings at that time.
- Begin data import. After authorizing Common Room, your data will start to import. Importing your data may take up to a few hours, and we’ll email you when everything’s ready. In the meantime, you can take a peek into Common Room. The charts and functionality may be a little empty to start but will populate as your data flows in.
For large GitHub repos, data imports may take several days to complete due to GitHub API restrictions. You'll receive an email as soon as the import is ready.
Technical details
The GitHub integration is available on all plans and requires approval from a GitHub organization admin.
Your GitHub admin is not required to be a Common Room user. If you aren't an org admin yourself and proceed through the integration setup, GitHub will send an email to your org admins requesting their approval. Common Room will begin importing once they approve the request.
Contacts and Activity
Contacts are created from users who have created or commented on an issue, pull request, or discussion, and from users who have starred any repos.
When connecting to GitHub, you can configure which repositories you’d like to import. Within your specified repositories, Common Room will create members and activities for every GitHub user who:
- Stars a repository
- Forks a repository
- Creates or comments on an issue
- Creates, closes, merges, or comments on a pull request
- Merges a commit
- Posts or replies in a Discussion
Import history
Once you configure your GitHub integration, Common Room will import the entire activity history from the repositories you’ve chosen. This may take some time depending on the size and age of the repositories.
If you had a Common Room team member provision your GitHub integration for you, by default, the past six months of data will be imported. This time period can be changed if needed by reaching out to your Customer Success Manager.
Sync frequency
Once the integration is configured, Common Room will automatically import new activity within a few minutes of it occurring on GitHub.
Obtaining a GitHub API Key
There may be occasions where, in order to action a customer request (like connecting an unowned repo in Common Room), our team will request to be sent a GitHub API Key. To send over this key, please follow the instructions below:
- Log into your personal GitHub account and go to https://github.com/settings/tokens/new
- Create a new personal access token (classic) with the following parameters:
- Note: "CR Imports"
- Expiration: No expiration
- Select scopes: Check the boxes for "read:org," "read:user," and "user:email."
- Click "generate token" and copy the resulting token (starts with “ghp_“)
Normally, we don't recommend that we or our customers share API keys or tokens over Slack. In this case it is safe to do so, as these tokens are not sensitive and can only read public GitHub data.
FAQ
When I connect to all GitHub repositories, does this include both public and private repos?
Common Room only ingests information from public repos, regardless of the option you choose. Private repo information will never appear in Common Room.
How can I sync additional GitHub repositories to Common Room?
In Common Room, open Settings → Signals → GitHub, select "Add Another Account," choose the account that's already connected and select both the new repos they want and the existing repos that were already connected. Note that
If a Contact unstars a repo, will this appear in their activity?
No. If a Contact stars a repo, this activity will appear in their profile. However, if a Contact un-stars a repo, the activity and history of them starring it will be removed from their profile.
Why is there a difference between connecting an owned vs. unowned repo in the platform?
Owners of GitHub repos can grant access with OAuth, which is much more secure and easy to set up than exchanging API keys. However, if you want to listen to a repo that you don't own, you can't OAuth to it (because the OAuth protocol validates access permissions). In these cases, we use an API key, which allows access to the repo and related info without utilizing any global rate limits, helping us keep your data as fresh as possible using the key provided (as opposed to using a shared key, which would hit rate limits and not let us ingest as fast as we can with a unique key). Note that when pulling in unowned repos via API key, new repos must be explicitly added as they are not not automatically ingested.