Buddy and 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.
Find out more about GitHub Apps authentication in this blog post.
Setting up GitHub integration
- As the first step, navigate to the Integrations tab and click New integration.
- Look up and click GitHub (it can be found under the Git category):
GitHub integration selection
- The configuration window will show up:
GitHub integration configuration
Here you have to provide the integration name and select the authorization method:
OAuth authorization
- In the integration configuration window, select permissions scope for your integration (Read/Write or Read-only) and click Start authorization:
GitHub OAuth authorization configuration
- In the GitHub popup window, click Authorize Buddy to grant Buddy access to the required information from your GitHub account.
Permission requirements screen
- Select which organization's repositories you want to use in Buddy:
Selecting GitHub organization
- 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:
Selecting the scope of GitHub repository access
- 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.
Personal Access Token (classic) authorization
- In the integration configuration window, select Personal Access Token as the authorization method:
GitHub Personal Access Token authorization configuration
Click 'Get token' in the Token field.
You will be redirected to your GitHub account. Define a new token there and select its access scopes:
Obtaining personal access token from GitHub
Click Generate Token at the bottom of the page and copy it.
Paste the token in the Token field in Buddy and click Add a new integration.
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:
- Enter the Integrations tab in the left navigation panel.
- Find the GitHub integration you want to adjust on the list.
- Click
Set permissions
to open a GitHub popup window.
Integration settings in Buddy
- 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.
đź“š 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
- When setting up the integration for the first time, open the Integrations tab and click New integration.
- Look up and click GitHub EE (you can find it in the Git section):
GitHub EE integration selection
- The configuration window will show up:
GitHub EE integration configuration
Here you have to provide:
- GitHub Enterprise IP or URL
- Personal access token (either classic or fine-grained)
- Once done, click Add a new integration to add the integration to your roster.
Personal Access Token (fine-grained) authorization
- In GitHub, click on your avatar and select Settings.
- Navigate to Developer settings from the left menu:
Developer settings location in GitHub
- 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:
Generating new fine-grained token in GitHub
- Enter the name for your token and select the expiration date (maximum one year from the date of creation):
Fine-grained personal access token details
- In the Repository access section, select the access scope:
Repository access permissions for token configuration
- Finally, select the permissions:
Recommended permissions for integration with Buddy
- Click Generate Token and copy it:
Newly generated token in GitHub
- Paste the generated token in the integration configuration window in Buddy:
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 June 14, 2024