# 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 Github REST API (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 via Github Apps, each connection you create is tied to 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: 4/5/2023, 11:28:53 AM