Airtable Sync integration: GitHub Pull Requests
  • 14 Sep 2022
  • 4 Minutes to read
  • Dark
    Light

Airtable Sync integration: GitHub Pull Requests

  • Dark
    Light

Airtable Sync integrations allow you to bring information from external tools into a single, centralized table within Airtable. This article covers the process of syncing Pull requests connected to a GitHub branch repository, based on a customized filter set up in Airtable, to an Airtable base. It's worth noting that this sync integration only works with GitHub Enterprise Cloud or GitHub.com. This sync does not work with GitHub Enterprise Server.

If you haven’t set up a sync before, we recommend first reading the Sync - Basic setup article to become familiarized with how Airtable Sync works.

NOTE

This feature is generally available, but still in a beta state. If you have any feedback, then please provide that here.


Add a new synced table

Start by clicking the "+" symbol next to your list of tables. Then, under “Sync data from”, select the “More...” option. From there, you should see the "GitHub Pull Requests" option.

5452674553879syncGitHubPRFindSync04142022.png


Select a GitHub account

Select an existing GitHub account (if you’ve already connected to GitHub before), or link to a new GitHub account if this is the first time you've set this sync up.

5451968774551syncGitHubPRSelectAccount04142022.png

Connecting a new account will take you to the authentication window. For more info on authentication and authorization jump to the section below.


Select repo

After you have connected your account successfully, you will need to connect to a repository or "Repo."

5452002187671syncGitHubPRRepoInstall04142022.jpg

If this is the first time you are syncing Airtable with Pull requests in GitHub, then you will need to install an app connector which you can click on within the sync setup window or by clicking here. This is a requirement on GitHub's end that is needed to allow this sync to work. The installation screen will look something like this:

5452165142423syncGitHubPRInstallConnector04142022.jpeg

Installing this app allows us to read metadata and read and/or write to issues. More information about this is in the Authentication and authorization section below.

During the app connector installation, you will choose whether to show “All repositories” or “Only select repositories.”

5452245463063syncGitHubPRRepositoryAccess04142022.jpeg

After installing the app successfully, you will see the repositories that you have set up in GitHub. Now you can choose the repo you would like to sync to Airtable.


Select state and created after date

After choosing the repository you’ll need to choose which pull request state to sync. The options are to show only “Closed,” only “Open,” or “All” Pull requests. Additionally, you’ll choose a “Created after” date that will only sync in Pull requests after that selected date.

5452237861143syncGitHubPRStateCreated04142022.jpg

Once you’ve filled in these two fields, click “Next.”

NOTE

GitHub’s API has limits on pull requests. Therefore, when choosing a “Created after” date that is further back in the past you should expect longer wait times for the synced table to be created.


Select fields to sync

Next, you’ll be presented with two sync options; you can sync:

  • All fields from the GitHub issue, including any fields added by Jira in the future.
  • Specific fields from the GitHub issue.

If you choose to sync specific fields you’ll be shown a menu where you can toggle each individual field that you want to sync from the GitHub Issues source.

5452353634455syncGitHubPRFields04142022.gif

Currently, GitHub supports 19 fields related to Pull requests:

1.Title7. Updated At13. Requested Reviewers
2. PR Number8. Closed At14. Requested Teams
3. State9. Merged At15. Locked
4. Labels10. Merge Commit SHA16. Draft
5. Body11. Created By17. Milestone
6. Created At12. Assignees18. PR Link


19. ID

Click the "Next" button after you have chosen which fields should be synced to Airtable.


Create synced table

In the last step before creating your synced table, there are “Settings” options that allow you choose how often you want to sync, and how to handle issues deleted or hidden in GitHub.

  • The frequency of syncing. Right now, the options are manual syncing and automatic syncing which happens around every 5 minutes.
  • Whether or not deleted issues in GitHub should be removed from the Airtable table. By default, deleted issues will be removed.

5452437918359syncGitHubPRSettings04142022.jpg

Once you’ve selected your desired settings, click the “Create table” button. This will create the new table with any synced Pull requests that match the conditions you’ve set up during the sync configuration process.

5452433790231syncGitHubPRCreateTable04142022.gif


Security and OAuth scopes

Authentication and authorization

The authentication window will lead to an authorization window. Authorizing allows us to verify your GitHub identity, know which resources you can access, and act on your behalf.

5452567642391syncGitHubPRPermissions04142022.jpeg

Airtable only supports a single GitHub external account type, so the scopes listed below are used for the Airtable Sync integration as well as the GitHub automation actions. That is why Airtable requests write access even when setting up a sync, even though we only use the read request portion for the sync.

Airtable will only have access to the issues that the user who connected the GitHub account has access to. Furthermore, it will only have access to issues in repositories that the Airtable Connector GitHub App is installed in. If the user who connected the GitHub account leaves the company and their GitHub account gets deactivated, the sync and automation actions will stop working.

For more information on GitHub scopes, check out GitHub's documentation here.


FAQs

Why is the synced table taking so long to be created?

GitHub has API rate limits in place to prevent too many Pull requests being referenced at one time. For repositories with many pull requests, expect to wait for longer periods of time when initially creating the synced table.


Was this article helpful?