Connect with GitHub Cloud
GitHub provides hosting for software development and version control using Git.
To integrate SEI with Github, you must choose the type of your Github account.
To integrate with GitHub Enterprise Server, go to Connect with GitHub Enterprise.
SEI only ingests repositories from organizations. SEI doesn't ingest your personal repos or repos where you are a collaborator but not a member of the affiliated organization.
In other words, the owner of the GitHub personal access token that is associated with the integration must be a direct member of an organization for a repo to be ingested by SEI.
Authenticate with GitHub
To create a GitHub personal access token to configure the SEI GitHub integration.
-
Log in to your GitHub account and create a Personal Access Token. For instructions, go to the GitHub documentation on Managing your personal access tokens.
-
Select the following permissions for your personal access token:
- All
repo
scopes, including the parentrepo
scope. The top-levelrepo
scope is required for SEI to have the required visibility into your repos.
- The
read:org
scope underadmin:org
.
- All
-
Copy the token somewhere that you can retrieve it when you configure the integration.
-
If your GitHub organization uses SAML SSO, enable SSO for your personal access token. For instructions, go to the GitHub documentation on Authorizing a personal access token for use with SAML SSO.
If you have enabled an allow list in your GitHub account, certain Harness IP addresses must be added to it in order to allow communication between the Harness Platform and GitHub. If the necessary IPs are not whitelisted, the integration may fail to authenticate or sync data properly.
To ensure your integration can work correctly, please refer to the list of Harness Platform IPs that may need to be whitelisted in your firewall.
Add the GitHub integration
For the integration type as Cloud, you can choose how you want to connect GitHub i.e.
- GitHub App
- GitHub Access Token i.e. Personal Access Token (classic)
- Using Github App
- Using Personal Access Token
The GitHub App facilitates a seamless connection to GitHub with minimal user intervention, requiring GitHub organization admin configuration for the app.
Using the GitHub App allows you to retrieve all user emails from GitHub, making it faster and easier to connect and manage the integration.
The following permissions are required to configure the Harness SEI Github App integration:
- Read access to administration, code, commit statuses, issues, metadata, and pull requests: This allows the app to view and access information about your repositories, including code, commits, issues, and metadata.
- Read access to email addresses: This allows the app to view the email addresses of users who have authorized the app.
It is important to note that these permissions are requested by the Harness SEI Github App. This means that the app will request these permissions from GitHub on its behalf, and not on behalf of the user who is installing the app.
To set up the integration using the GitHub App:
- Select Integrations under Data Settings.
- Select Available Integrations, locate the GitHub integration, and select Install.
- Select GitHub Cloud as the integration type.
- Select the GitHub App tile to set up the connection with GitHub.
-
Verify that your account is an owner of the GitHub organization that you want to connect. To do this, go to your GitHub organization page and ensure that your account is listed as an owner.
-
If you've previously connected SEI to GitHub, you may need to remove the SEI app from GitHub before proceeding.
-
Click the Connect GitHub button to begin authentication.
-
Once authenticated, you'll be prompted to select the repositories that SEI will monitor. You can choose to monitor all repositories or select specific ones.
Note that if you select All Repositories, SEI will automatically monitor all existing and future repositories. If you select Only Selected Repositories, SEI will only monitor the repositories you've chosen.
-
Now on the GitHub App settings page add the basic overview information:
- Integration Name: Name for your integration.
- Description (optional): Add a description for the integration.
- Tags (optional): Add tags for the integration if required.
- Once you've configured the settings click on Finalize Integration to save the integration.
Before you configure the SEI GitHub integration, you must generate a GitHub Personal Access Token.
- Select Integrations under Data Settings.
- Select Available Integrations, locate the GitHub integration, and select Install.
- Select GitHub Cloud as the integration type.
- Select the Using Access Token tile to set up the connection with GitHub.
-
Configure the integration settings and authentication:
- Integration Name: Name for your integration.
- Description (optional): Add a description for the integration.
- Tags (optional): Add tags for the integration if required.
-
Add the PAT Key that you previously generated for your GitHub account.
-
If applicable, configure the Additional Options. This allows you to specifically select the fields that you want to include in the data ingestion.
- Fetch PRs: Allow SEI to ingest PR data from GitHub.
- Fetch Issues: Allow SEI to ingest data from GitHub Issues.
- Fetch Projects: Allow SEI to ingest data from GitHub Projects.
- Fetch Commits: Allow SEI to ingest commit metadata from GitHub.
- Fetch Commit Files: Allow SEI to ingest data within commits from GitHub.
-
Click on Validate Connection to validate the connection, and once successful, you'll have the integration set up under the Your Integrations tab.