GitHub Integration

What is GitHub?

GitHub is a version control platform used for collaboration in software development projects. Featuring pull requests, branching, code review, and issue tracking, it is a popular choice for projects utilizing Git version control system.

Connecting your GitHub repositories with Buddy lets you trigger pipelines whenever changes are made to your source code and automate various tasks related to Continuous Integration and Continuous Deployment (CI/CD).

Since testing is an integral part of software engineering, hooking your repo with Buddy lets you automate the execution of unit tests and integration tests, either on changes pushed to the repository, or recurrently.

In addition to automated testing, you can expand and secure your software development process by enforcing pull requests for merging changes into the production environment.

Hint
Buddy uses GitHub Apps to get the necessary account information and access the repositories you want to use in CI/CD pipelines.
Warning
GitHub Apps was introduced in November 2021. Projects created before November 2021 remain fully functional and require no action, as they continue using the legacy OAuth-based integration.
Find out more about GitHub Apps authentication in this blog post.

Setting up GitHub integration

  1. As the first step, navigate to the Integrations tab and click New integration.
  2. Look up and click GitHub (it can be found under the Git category):

Image loading...GitHub integration selection

  1. The configuration window will show up:

Image loading...GitHub integration configuration

Here you have to provide the integration name and select the authorization method:

Hint
You can adjust the privacy settings of your integration (i.e. who can use it and where) in the Sharing tab.

OAuth authorization

  1. In the integration configuration window, select permissions scope for your integration (Read/Write or Read-only) and click Start authorization:

Image loading...GitHub OAuth authorization configuration

  1. In the GitHub popup window, click Authorize Buddy to grant Buddy access to the required information from your GitHub account.

Image loading...Permission requirements screen

  1. Select which organization's repositories you want to use in Buddy:

Image loading...Selecting GitHub organization

  1. Decide whether you want to give Buddy access to all GitHub repositories within the selected organization, or if you want to limit the permissions to a single repository:

Image loading...Selecting the scope of GitHub repository access

  1. Once the configuration is completed, click Add project in your Buddy workspace and choose the repository you want to use. Then you will be able to add your first CI/CD pipeline to the project.
Success
When you create the project, Buddy adds a webhook to your repository. This allows to trigger deployments whenever new commits are pushed to the repo when using the On Push pipeline execution trigger mode.
Hint
The contents of the connected repository are reproduced in read-only mode. To view them, go to the Code tab, where you can also browse the files and view commit history.

Personal Access Token (classic) authorization

  1. In the integration configuration window, select Personal Access Token as the authorization method:

Image loading...GitHub Personal Access Token authorization configuration

  1. Click 'Get token' in the Token field.

  2. You will be redirected to your GitHub account. Define a new token there and select its access scopes:

Image loading...Obtaining personal access token from GitHub

  1. Click Generate Token at the bottom of the page and copy it.

  2. Paste the token in the Token field in Buddy and click Add a new integration.

  3. When ready, you can add a new project and start creating your continuous delivery pipeline.

Managing repository access

After adding the integration, you can adjust its access scope or change the GitHub organizations it works with:

  1. Enter the Integrations tab in the left navigation panel.
  2. Find the GitHub integration you want to adjust on the list.
  3. Click Set permissions to open a GitHub popup window.

Image loading...Integration settings in Buddy

  1. In the popup window, click the organization name you are already using to change the access scope or revoke access. Choose an organization you haven't used before to configure it and start using it in Buddy.
Tip
Look for the word "Configure" to identify the organization(s) you are already using in Buddy.
Hint

📚 Learn more about GitHub action features, integrations and alternatives.

What is GitHub Enterprise Server?

GitHub Enterprise Server is a self-hosted version of GitHub's platform. It lets organizations host and collaborate on their GitHub projects on their own infrastructure.

Integrating Buddy with GitHub EE Server allows you to set up pipelines that will build, test and deploy your application on each push to your GH repository.

Setting up GitHub EE integration

Warning
The GitHub EE action works only with the personal access token integration type.
  1. When setting up the integration for the first time, open the Integrations tab and click New integration.
  2. Look up and click GitHub EE (you can find it in the Git section):

Image loading...GitHub EE integration selection

  1. The configuration window will show up:

Image loading...GitHub EE integration configuration

Here you have to provide:

  • GitHub Enterprise IP or URL
  • Personal access token (either classic or fine-grained)
Hint
You can adjust the privacy settings of your integration (i.e. who can use it and where) in the Sharing tab.
  1. Once done, click Add a new integration to add the integration to your roster.

Personal Access Token (fine-grained) authorization

  1. In GitHub, click on your avatar and select Settings.
  2. Navigate to Developer settings from the left menu:

Image loading...Developer settings location in GitHub

  1. Go to Personal access tokens. Two types will appear:
  • Classic tokens
  • Fine-grained tokens, a new method which allows more granular control over permissions and repository access and therefore has several security advantages over the classic type

In this case, use the fine-grained type and click Generate new token:

Image loading...Generating new fine-grained token in GitHub

  1. Enter the name for your token and select the expiration date (maximum one year from the date of creation):

Image loading...Fine-grained personal access token details

  1. In the Repository access section, select the access scope:

Image loading...Repository access permissions for token configuration

  1. Finally, select the permissions:

Image loading...Recommended permissions for integration with Buddy

Hint
The recommended permissions are displayed above. You can read about other permissions here.
  1. Click Generate Token and copy it:

Image loading...Newly generated token in GitHub

  1. Paste the generated token in the integration configuration window in Buddy:

Image loading...GitHub EE Server integration configuration in Buddy

You have successfully synced GitHub with Buddy, and you're ready to set up your first pipeline.

Last modified on Jan 29, 2025