Skip to content →

GitHub

Linear supports linking your GitHub pull requests, automating workflow statuses, and syncing issues between GitHub and Linear.

Linear logo and Github logo

Overview

The GitHub integration offers two core functionalities:

[@portabletext/react] Unknown block type "web.table", specify a component for it in the `components.types` prop

Permissions

The integration needs the following permissions for Pull Requests and GitHub Sync:

  • Read access to checks and metadata
  • Read and write access to issues and pull requests

Linking Linear issues to commits is handled through GitHub webhooks, which do not require access to your codebase.

To grant Linear organization-level access in GitHub, the integration must be installed by a GitHub organization owner. If you only need repository-level access, a repository administrator can install the integration instead.

Configure

Enable the GitHub integration

  1. Go to Setting > Features > Integrations > GitHub
  2. Click Enable
  3. Select the GitHub organization you want to connect
  4. Select All repositories or Only select repositories and choose the repositories you want to connect
  5. Click Install
  6. Authenticate into your personal Github account

GitHub Enterprise options

If it's relevant to your organization, GitHub Enterprise Cloud and GitHub Enterprise Server require additional setup compared to GitHub.com. See the following section for details of each.

If you're using GitHub Enterprise Cloud and have IP Allow List security setting enabled, you'll also need to turn on Enable IP allow list configuration for installed GitHub Apps setting to enable Linear's GitHub integration. Read more here.

Alternatively you can grant access to Linear's IP addresses:

35.231.147.226

35.243.134.228

34.140.253.14

34.38.87.206

34.134.222.122

35.222.25.142

The table below provides a comparison of available features across GitHub.com, GitHub Enterprise Cloud, and GitHub Enterprise Server.

FeatureGithub.comGitHub Enterprise CloudGitHub Enterprise Server
Installation MethodLinear GitHub AppLinear GitHub AppSeparate GHES App
IP RequirementsNoneIP Allow List config required if enabledNo special firewall rules
Multiple GitHub OrgsYesYesNo
PR LinkingYesYesYes
Branch Name FormattingYesYesYes
Status Automation from PRsYesYesYes
Magic Words for LinkingYesYesPR description only
Commit LinkingYesYesNo
Github Issues SyncYesYesNo
Issues Sync → Multiple Repositories to Single TeamYesYesNo

Add multiple GitHub organizations

Click the + icon under Connected organizations to add another GitHub organization. This will take you through the same flow as when you connected the first organization. Currently, we support multiple organizations for the PR automation only. You will only be able to use commit linking with a single GitHub organization.

It is not possible to connect multiple Linear workspaces to a single GitHub organization. This is a limitation on GitHub's side. GitHub Apps can only be installed once for a GitHub organization so this means only one Linear workspace can be connected.

Branch format

Select the branch format you want to use when copying the branch name using Cmd + Shift + . from a Linear issue and pasting it into your branch name.

Branch format setting

Personal account connection

In addition to the organization-level setup, each member should connect their personal GitHub account. This ensures that the activity feed, synced comments, and assignees are mapped directly to the connected user in Linear, rather than appearing as generic GitHub activity.

To connect your account, navigate to Settings > Connected accounts. Once connected, any synced activity from GitHub will be correctly attributed to you in Linear.

Section in your Github integration settings that indicates your personal account is not yet connected.
Connect your personal Github account to link issues with commits, PR, and branches.

Enable commit linking

  1. Turn on the toggle for Link commits to issues with magic words at the bottom of the GitHub settings page.
  2. Go to Settings → Webhooks in your GitHub organization or repository.
  3. Click Add webhook button
  4. Input the Payload URL and Secret provided in Linear, and select application/json content type. Leave "Push events" selected.
  5. Click Add webhook.
  6. Go back to Linear and click Done.
Setting to enable commit linking

Configure GitHub Issues Sync

Watch this video to see how GitHub Issues sync works:

From the GitHub Issues section of the GitHub integration settings, click the + icon, then select the GitHub repo and Linear team to link.

You can choose to sync:

  • One-way: issues created in GitHub will create a synced copy in Linear, or
  • Two-way: issues created in either the GitHub repo or Linear team will create a synced copy in the other software
Github Issue Sync configured for two repositories, mapped to their correlated Linear teams.
Setup for GitHub Issues Sync.

Multiple repositories can be connected to create issues to a single Linear team through one-way sync when issues are created in GitHub. However, only one repo can be configured for two-way sync at a time.

You can enable two-way sync when connecting a repo to Linear, or change this to another repo by pressing ... > Edit Link on an existing repo connection.

GitHub Issues Sync will only sync newly created issues. To sync existing GitHub Issues, you will have to import them. Refer to the Importer page.

Properties that are synced between Linear and GitHub issues include:

  • Title
  • Description
  • Status
    Please note that any custom statuses set at the GitHub Project level do not sync to Linear.
  • Assignee
    Linear users can connect their GitHub account from https://linear.app/settings/account/connections to be synced as the issue assignee
  • Labels
  • Sub-issues
    Multi-level & cross-repository/team hierarchies are supported. If parent issue is not a synced issue (e.g. it's in a different GH repo/Linear team), the sub-issue can still get synced, but will have no parent issue set on the other end.
  • Comments
    Comments made not in the synced thread of the Linear issue will not get synced to the GitHub issue. This allows for private discussions.

Moving GitHub synced Linear issues between Linear teams will maintain the synced relationship. You can also transfer GitHub issues between two synced repos; this will appropriately update the team of the associated issue in Linear.

To manually stop syncing, remove the attachment from the Linear issue through its overflow menu.

Issue sync banners

Once an issue is synced between GitHub and Linear, a banner will appear at the top of the issue to make this clear. The banners will display information to show current sync status or will surface any errors with syncing.

Synced issue banners showing connected and a sync error

Linking Linear issues to GitHub PRs

You can link a Linear issue using pull requests or commits.

Watch this video for a quick demo on the available linking methods:

Link through pull requests

[@portabletext/react] Unknown block type "web.table", specify a component for it in the `components.types` prop

Link multiple issues

Link multiple issues to one PR

Include multiple issue IDs after the magic word in the description (e.g. Fixes ENG-123, DES-5 and ENG-256). Linking will happen after you save your changes. Magic words must be used in the PR description, they will not work if linked in a comment on the PR.

Link multiple PRs to one Linear issue

You can link multiple PRs to a single Linear issue using any linking technique. The Linear issue status will be updated when the final linked PR moves to the required state from your workflow.

For example if you have 2 PRs linked to 1 issue, you'll need merge both PRs before the Linear issue status will change.

Link using commits

Use a magic word before the issue ID in commit message to link issues. We'll move the issue to In Progress when the commit is pushed and Done when the commit reaches the default branch.

Viewing a linked Linear issue

Remove a PR from an issue

To remove a PR from a Linear issue, open the issue, click on the three dots on the PR attachment, and select Remove. You can also do this through the command menu in Linear by viewing or selecting an issue, then searching for git.

To link a PR that is already open, modify the PR title or description to link an issue.

PR review state

When individual reviewers comment, request changes, or approve your PR, we'll display their avatars and their actions on the GitHub attachment visible on the linked Linear issue. You can use this feature to quickly parse the review state of your PR without needing to return to GitHub.

PR comments and approved state displayed in Linear attachment.

If you request a team review instead of a review from specific individuals, we display "review requested" or "in review" on the GitHub attachment in place of user avatars.

Pull request preview links

If your PR contains one or multiple preview links, this will add a preview link shortcut to the Linear issue.

Preview links are automatically detected for popular platforms like Vercel, Netlify, Cloudflare and AWS Amplify if you have connected Linear with your GitHub repository. We also support custom preview links: pull request descriptions and comments are parsed for any markdown links ending with "preview," once these are added by the PR author or a GitHub bot.

Multiple previews for a single PR are available in a dropdown menu, with customizable names and icons for easy identification (e.g. mobile and desktop previews). Icons are automatically chosen to reflect best their name, such as a mobile icon for mobile release links. Preview links are automatically removed after 30 days of inactivity on the PR.

Preview links on a Linear issue

Pull request preview link accepted formats

Links that end with "preview" in your PR descriptions and comments will get added to the Linear issue as a preview link.
For example:

PR containing preview links

Workflow automation

Issue status updates

Updates to PRs can automatically update the status of their linked Linear issues.

Watch this video to explore more about how issue status automation works:

You can customize the automation in Settings > Team > Issue statuses & automations > Pull request and commit automation. Since this is a team setting, it must be configured for each team in your workspace.

You can configure status updates when PRs are drafted, opened, have a review requested, are ready for merge, and merged. By default, we will move linked issues to "In Progress" when PRs are open and "Done" when PRs merge.

Pull request and commit automation
The "Ready for merge" automation relies on GitHub reporting a stable/mergeable PR status. If any check (including non-required checks) fails, GitHub reports the PR as unstable and the automation to move issues to the ready-for-merge destination will not trigger.

Custom merge queues

If you use a custom merge queue that merges changes and then closes the pull request, be sure to add the externally-merged label before closing it. This tells Linear to treat the pull request as successfully merged even though it was closed.

Branch protection rules

Once a review is requested, if you do not have branch protection rules set up in GitHub, the issue will skip the "review request or activity" state and move to "ready to merge”. Without branch protection rules, a PR is considered always mergeable. Please note that "ready to merge" automations will not fire if a "review request or activity" automation is not also configured.

Branch-specific rules

You can also set custom workflow automations based on particular target branches.

For example, you can now configure that when a PR is merged to:

  • staging, the issue status should change to “In QA”
  • main, the issue status should change to “Deployed”
Branch rules apply only to target branches—the branch a PR is being merged into. Automations are not supported for source branches, the branch the PR is created from.

Watch this video to visualize how branch-specific rules work:

You can also override a default rule in a particular branch with “no action” if desired, so that issues linked to a change in that branch will not change status. Branch rules can be specified using regex, e.g: ^fea/.* can set automations for all feature branches.

Image shows a set of default rules, rules specific to a "staging" branch.

Auto-assign and move issue to start

Save yourself a few steps by toggling on our automations that auto-assign the issue to you and move it to a started status when you copy the git branch name. To set up this automation, refer to Preferences.

Other settings

Linkbacks

When an issue is linked with a pull request, commit or GitHub Issue, Linear posts a linkback message as a comment with the issue title and description—including any images or attachments that exist within the description. All the pull requests are also listed in the issue details in Linear. This cross-referencing makes it faster to retain context without jumping between apps.

If enabled for private teams, the issue titles will not be included in the comment. The link will go to your Linear issue and be accessible only by users who are part of that private team.

Setting for enabling or disabling linkbacks.

Enable Autolink

If you want to automatically resolve your Linear issue IDs (e.g. ENG-123) in PR descriptions or comment to links, you can enable this using GitHub's Autolink references feature. See instructions on GitHub.

Use the following URL format: https://linear.app/<workspace>/issue/ID-<num> where workspace corresponds to your workspace's URL and ID is the issue identifier key for your team. You need to add each team separately as they all have a different ID pattern.

If you change your Linear team name/ID, you may need to reconfigure the Autolink settings.

FAQ