# GitHub

GitHub (opens new window) is a popular version control application used by millions of developers and companies.

The GitHub connector enables you to build powerful automation around GitHub to help manage these software development processes and manage your agile sprints.

# API version

This connector uses the GitHub REST API v3 (opens new window).

# How to connect to GitHub on Workato

There are two ways to connect to GitHub on Workato:

  1. Traditional OAuth Apps where Workato recipes can act on your behalf. See here.
  2. Creating your GitHub App where Workato recipes can act as the App. See here.

Learn the differences here (opens new window).

In most cases, we follow GitHub's recommendations to create GitHub apps for fine grained access control. Since GitHub apps do not assume any user's identity, there is also clearer insight into the work your recipes are doing.

TIP

When you create a connection through GitHub Apps, each connection you create is tied to a specific installation of your GitHub App in an Organization or user's account.

# Traditional OAuth

Authenticating to GitHub with traditional OAuth simply requires you to click connect. You will be redirected to GitHub where Workato's OAuth app will request authorization to act on your behalf. The creation of comments, issues, or pull requests will be done under the authenticated user's name (you).

Oauth app auth Select Authentication type as OAuth app and click connect!

# GitHub App authentication

Authenticating to GitHub with GitHub apps requires you to do a few additional steps.

GitHub app auth Select Authentication type as GitHub app and collect details from your GitHub App!

# Step 1: Create your GitHub App if you have not done so

This GitHub app will be tied to your Workato connection. You can create the GitHub app to have a unique name and avatar so all your teammates know that this is an automation that is making changes in their repository.

Learn how to create a GitHub app here (opens new window).

# Step 2: Install your GitHub App into the Organization/User account if you have not done so

Besides being tied to a specific GitHub app, this Workato connection will also be tied to a specific installation of this GitHub app. You can install a GitHub app into any organization that you own or are an admin of. Simply head over to your GitHub app's settings page and select the Install App section.

Install App section From this section, you will see a list of organizations you are a part of where you can install this app.

TIP

If you try to install a GitHub app into an organization that you are not an admin of, you will instead make a request to the admins of that organization to install it.

# Step 3: Retrieve your GitHub App ID and private key from the App settings page

Your Workato connection now need credentials from your GitHub app. Your App ID can be found in the General settings page of your GitHub app.

app id Save this App ID and place it into your connection

You will now need to scroll down on the page to where you can generate Private keys. This is still on your General settings page.

Generate private key Generate the private key

This key should be downloaded automatically to your machine. You will need to open this .pem file using your text editor to reveal your private key. It should be in the following format (but longer):

-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAyL/wuiSaWoH0pyf366G5E7dbzzmON1qMMrWvls8RtZtgOLjb
FBxj6gO2aUfoGbMCMqOYRV6xCn6tK118sGYMd5U/kCFu3IRPr/2GoEtcrf0TecQG
ON+27ijH0Vpn62o8NzGejdy0AWujrtAl6F8xGZeze0PzrGvW6h/GnAdZO1gJnp8t
wmEqEMXqAsPOQ0hkY+r+pE8RKQVsJCe+PIanBKp7RKWDi9usPFZQdQ==
-----END RSA PRIVATE KEY-----

Copy this entire key including the -----BEGIN RSA PRIVATE KEY----- and -----END RSA PRIVATE KEY-----. Paste it into your connection under the input for GitHub App Private key.

# Step 4: Retrieve your installation ID

Your installation ID can be found in the Organization or user that you have installed your GitHub App too.

For users, please navigate to your Settings > Applications > Your GitHub App > Configure. The installation ID can be found at the end of the URL - if the URL is https://github.com/settings/installations/13876669, your installation id is 13876669.

For organizations, please navigate to your organization's GitHub homepage. Head over to Settings > Installed GitHub Apps > Configure. The installation ID can be found at the end of the URL - if the URL is https://github.com/settings/installations/13876669, your installation id is 13876669.

Save this installation ID and enter it into your Workato connection. You should now be good to go!


Last updated: 5/17/2024, 2:35:03 AM