Skip to article

Install the GitHub App

Install the Merget GitHub App, connect an existing installation and understand the permissions it asks for.

On this page

Merget works through the Merget GitHub App. The App lets Merget read your pull requests and report on them, and in Queue and Autonomous modes it lets Merget push prepared commits and merge. You install it once on each GitHub organization or personal account that owns repositories you want Merget on, then link that installation to your Merget organization.

Before you start

  • You need the Owner role in the Merget organization. Members see a note that an owner of the organization has to install the Merget GitHub App, instead of an install button. See Team and access.

  • You need to be able to install apps on the GitHub account. For a GitHub organization, that usually means being an organization owner on GitHub, or having your request approved by one.

  • Sign in to Merget with GitHub if you can. When you install the App yourself after signing in with Continue with GitHub, Merget links the installation without an extra verification step. See Sign in and organizations.

  • Open the right Merget organization first. The installation is linked to the organization you start from.

One installation belongs to one Merget organization at a time. One Merget organization can hold several installations, for example two GitHub organizations and a personal account, and manage all their repositories together.

Install the App

You can start an install from these pages:

  • Home: Set up Merget under Connect repositories to Merget (or Connect GitHub, when your own GitHub account is not linked yet) opens the setup page, whose one button links your GitHub account if needed, installs the App and brings you back to turn repositories on.

  • Merge Queues: when no installation is linked, the page shows Connect Merget to GitHub with the button Install Merget on GitHub.

  • Analytics: when no installation is linked, owners see an Install Merget on GitHub card. It lists What happens next: install the App, pick repositories on GitHub, then enable them in Merget.

  • Settings › GitHub: the button Add GitHub organization (it works for personal accounts too). Open Settings › GitHub.

Then:

  1. Click the button. It reads Opening GitHub… and your browser moves to GitHub's install page for the Merget App.

  2. On GitHub, pick the GitHub organization or personal account that owns your repositories.

  3. Choose which repositories the App may access:

    • All repositories: every current and future repository of the account. This gives the App access; a repository's build still needs a separate dependency access grant before it can fetch another private repository.

    • Only select repositories: just the ones you pick. You can change this at any time (see Change which repositories Merget can see).

  4. Review the permissions (see Permissions) and click Install. If GitHub asks you to authorize the App for your GitHub account, approve it.

  5. GitHub returns you to Merget. See Coming back to Merget.

Important

An install link works once, for a short time, and only for the person who started it. If you come back on one that was used or has expired, Merget asks you to confirm the connection instead of linking it straight away (see Connecting GitHub outcomes).

If the App is already installed on a GitHub account and no Merget organization has that installation, the Install Merget on GitHub button on Merge Queues and Analytics, and the setup page's button, connect it instead of opening GitHub, when your GitHub account can vouch for it or when you started connecting it in this browser in the last 15 minutes. With several such installations it opens Settings › GitHub, where each has its own Connect. To install on another GitHub account instead, use Add GitHub organization there.

If GitHub shows Configure instead of Install, the App is already installed on that account. GitHub brings you back to Merget only after you save something there: if your organization already has the installation, Merget applies the change (see Changes you make on GitHub). If you started from Merget's install button, Merget then connects it as it would a new install, and offers to move it when another organization has it. Otherwise use Already installed on GitHub?.

Three-stage schematic: open Settings then GitHub in the intended Merget organization; install the Merget App for a GitHub account and select repositories; return to Merget and enable repositories.

Illustration: connect the GitHub App, choose its repository access, then enable repositories in Merget.

What to look for
  • In the intended Merget organization, an owner opens Settings, then GitHub, then Add GitHub organization.
  • On GitHub, choose the account and repository access, review permissions and install the Merget App. Additional verification may be requested.
  • Return to Repositories in Merget. The linked repositories start turned off; enable each one you want to use.

The setup page

The setup page connects GitHub and turns repositories on from one button. Home's setup card opens it, and so does the link your coding agent gives you after the setup prompt, which names the repository it is working in, for example Connect GitHub and turn on Queue mode for acme/web.

  • The button is your confirmation. Whatever is missing then runs in order without another click: linking your GitHub account, installing (or connecting) the App, and turning the repository on. Each trip to GitHub comes back to this page in the same browser tab, for up to 30 minutes.

  • Queue mode, unless the link says Advisory. The page shows what the mode does and, for Queue, the Terms' sentence on automated changes. A link never chooses Autonomous; the page's own mode choice can.

  • No repository named, or the one named is not on the installation: the page lists the repositories you can see to tick, with the mode to turn them on in.

  • A step that did not finish shows the button again rather than going round the same loop. A refusal shows here with its fix, for example GitHub permission change required.

  • Members see that an owner connects GitHub; once the App is installed they can turn repositories on here.

When the repository is on, the page says Merget is on. If your agent sent you, go back to it: it sees the change and carries on.

Coming back to Merget

After you install, GitHub sends your browser to the Connecting GitHub page. It names the GitHub account and shows Linking the installation to your organization…. If you are signed out at that moment, Merget signs you in first and then carries on. If Merget needs GitHub to confirm that you administer the installation, your browser goes to GitHub once more by itself and comes straight back (see Verify with GitHub).

When the link succeeds, you go straight to Repositories, where the installation's repositories are listed, all turned off. Continue with Enable repositories. If you started from the setup page, you go back to it instead, and it carries on. If the installation was linked but GitHub could not list its repositories at that moment, you land on Settings › GitHub instead, where the failure is shown and Refresh tries again.

The installation is linked to the organization you started the install from, or the one whose Connect link you clicked. If the App was installed directly on GitHub instead, Merget links it to the organization you last opened in this browser if you are still a member of it, otherwise to the only organization you own. If neither says which one, the page asks Which organization is this for? and lists the organizations you own. Only an owner can link an installation.

If you reload the page after a connection did not finish, Merget keeps the installation and the organization, and asks Connect this installation? before linking it.

Changes you make on GitHub

When you change the App's settings on GitHub (for example its repository access, or new permissions you accept) and save, GitHub brings you back to Merget. The page shows Updating with the GitHub account's name, then:

  • Merget applies the change to the organization that has the installation, whichever organization you last opened in this browser;

  • you land on that organization's Settings › GitHub, with a summary of what changed: repositories added (they start turned off), removed, or back on GitHub, and new permissions;

  • the browser tab you opened GitHub from refreshes its list when you return to it.

Nothing is connected again and nothing asks you to verify. Members can do this too: a member who changes the App on GitHub lands on the same summary.

Connecting GitHub outcomes

TitleWhat it meansWhat to do
(none; you land on Repositories)The installation is linked.Enable the repositories you want.
(none; you land on Settings › GitHub)This organization already has the installation; Merget applied what you changed on GitHub. Or the installation was linked just now, but GitHub could not list its repositories; the page says so.Read the summary; re-enable repositories that are back. After a failed listing, click Refresh.
Which organization is this for?Nothing said which of your organizations the installation is for: you own several, and the one you last opened in this browser is not one of them.Click the organization. For a move, Merget then asks you to confirm it. If your organizations could not be loaded, click Retry.
Connect this installation?The page was not opened by an install or a Connect you started in this browser tab: GitHub sent you here by itself, someone sent you the link, or you reloaded the page.Check the GitHub account and the organization it names, then click Connect.
Request sent to GitHubYou asked a GitHub organization's admins to approve the App. Nothing is installed yet.Once they approve, someone who is an owner of your Merget organization and an admin of that GitHub organization (or the person who approved the App) connects it under Already installed on GitHub? in Settings › GitHub.
Saved on GitHubGitHub saved your changes to an installation another Merget organization has.Nothing to do here. To bring it into your organization instead, an owner moves it under Already installed on GitHub? in Settings › GitHub.
Moved to this organizationThe installation moved here from another Merget organization, with its run history. Every repository starts turned off.Click Open repositories and enable the ones you want.
GitHub has to confirm it is youMerget needs GitHub to confirm you administer the installation. Right after an install Merget goes to GitHub for this by itself, once; you see this title when that was not enough, or when you did not come from GitHub's install page.Click Verify with GitHub (see Verify with GitHub).
Another organization owns this installationA different Merget organization has this installation.Click Move it here if it is offered (see Move an installation). Otherwise click Install on another account to add a different GitHub account.
That installation is goneGitHub no longer has this installation: it was uninstalled.Click Install Merget on GitHub to install it again.
Only an owner can connect GitHubYou are a member of this organization, not an owner.Ask an owner to finish the connection. After that you can enable repositories as usual.
You are not in that organizationThe installation was being connected to a Merget organization your account is not a member of, for example from a link another account created.Open the organization you want in the dashboard and connect GitHub from Settings › GitHub.
That GitHub account cannot administer this installationGitHub says the GitHub account Merget checked, named on the page, is neither an admin of that GitHub account nor the person who installed the App. It can be an account you connected to Merget earlier, not the one you are signed in to on github.com.Sign in to github.com with the account that administers it and click Verify with another GitHub account, or ask an admin to connect it.
Merget could not check GitHub just nowMerget could not reach the service that holds your GitHub connection. Nothing was checked, and it is not about your account.Click Retry in a moment.
The installation could not be linkedSomething else went wrong. The reason appears underneath.Click Retry, or Verify with GitHub if offered.

Every error also offers Back to the dashboard. If you open the page without coming from GitHub, it says "This page expects to be opened by GitHub after installing the Merget app."

An install link that was already used or has expired no longer ends on an error. Merget reads which installation the link was for: if your organization already has it, Merget applies what changed on GitHub; otherwise the page asks Connect this installation?.

If a connection stops partway, for example at GitHub has to confirm it is you, you can come back to it: for the next 15 minutes Install Merget on GitHub (or the setup page's button) in the same browser returns you to that installation instead of opening GitHub again.

Verify with GitHub

Merget links an installation only for someone GitHub says administers it. When your sign-in alone doesn't show that, Merget asks GitHub. Right after you install the App, your browser goes to GitHub for this by itself, once, and comes straight back. Otherwise, or when that one trip was not enough, you see GitHub has to confirm it is you with a Verify with GitHub button. Verification is needed when:

  • you signed in to Merget with Google or email rather than GitHub;

  • none of your GitHub accounts is the one that installed the App;

  • you are moving an installation from another Merget organization (always required).

Click Verify with GitHub, approve the request on GitHub, and you come straight back. GitHub must confirm that:

  • for a GitHub organization, you are an admin of it, or you are the person who installed the App (when moving an installation, only an admin counts);

  • for a personal account, the account is yours.

After you sign in with GitHub, or install or verify an installation through GitHub, your GitHub account shows in Settings › Account in the GitHub card, beside any others you added. The same GitHub account can be linked from several Merget accounts.

Connect an existing installation

If the App is already installed on a GitHub account, for example because a colleague installed it or you installed it directly on GitHub, connect it from Merget:

  1. Open Settings › GitHub and find Already installed on GitHub? (owners only). From an empty Merge Queues page you can also click Already installed? Connect it.

  2. If you signed in with GitHub, the section lists the installations your GitHub accounts can vouch for: ones they installed, or the ones on their own personal accounts.

  3. To find any other account, type its name in GitHub organization or user (for example acme) and click Find. The match ignores case.

  4. Each row shows the account, whether it is an organization or a user, and one control:

    • Connect: no Merget organization has this installation yet. Click it.

    • Connected to this organization: nothing to do.

    • Connected to another organization, with Move here: see Move an installation.

  5. If asked, click Verify with GitHub.

  6. You land on Repositories with the installation's repositories, all turned off.

Lookup messages:

  • Merget is not installed on followed by the name: the App isn't on that account. Click Install Merget on GitHub.

  • That is not a GitHub organization or user name: letters, digits and hyphens only.: check the spelling.

A row can also show Suspended on GitHub; see Suspended installations.

Move an installation between organizations

An installation belongs to one Merget organization at a time. To move it into the organization you are in:

  1. Open Settings › GitHub › Already installed on GitHub? in the receiving organization. You must be an owner of it.

  2. On the row that reads Connected to another organization (or Connected to another organization if you aren't a member of it), click Move here. You can also click Move it here on the Connecting GitHub page.

  3. Read the Move GitHub account dialog. Type the account name exactly as shown to enable Move, then click it.

  4. On GitHub has to confirm it is you, click Verify with GitHub and approve. GitHub must confirm that you currently administer that GitHub account; having installed it once is not enough.

  5. On Moved to this organization, click Open repositories and turn on the repositories you want.

What moves and what resets:

Moves with the installationResets in the organization it leaves
Run history, findings and queue historyEvery repository is turned off and its settings return to defaults
The repositories themselves (they arrive turned off here)Queued work is cancelled and any standing merge request is stopped
—Repository validation secrets are deleted (organization secrets stay with the organization that set them)

The organization that loses the installation is not asked first, so agree on the move with its owners. For what "defaults" means, see Remove a GitHub account.

Permissions

The Merget GitHub App asks for these permissions:

PermissionAccessWhy Merget needs it
ChecksRead and writePosts the Merget check on each pull request and reads the results of your other checks. See The Merget check.
Pull requestsRead and writeReads pull requests and posts inline review comments. In Queue and Autonomous modes, it also resolves the review threads of Merget's own struck-through comments, retargets stacked pull requests and, in Autonomous mode, merges them.
ContentsRead and writeReads the repository code Merget needs to analyze changes and, when you turn on Merget's own build, to build them. Write access is used only in Queue and Autonomous modes: to push prepared fixes to pull request branches, to create and delete temporary branches for batches and for fixes your CI verifies, to land a ready batch on the target branch, and to resolve the review threads of Merget's own struck-through comments, which GitHub allows only with write access.
AdministrationRead and writeReads branch protection and rulesets. Allows Turn off strict when an owner confirms, and renames a legacy required check named sema to Merget on its own, in every mode, where the installation accepted it. Once Merget has read your batches' jobs (with Actions access), it also reads the self-hosted runners registered on the repository whenever it checks the repository's readiness, as when you open its settings, and the line under Batches in CI at once says how many are online where your batches' jobs ran on them. See Branch protection.
ActionsWrite, when grantedLets Cancel CI Merget no longer needs stop obsolete batch workflow runs. Without it, those workflows finish normally, and until they finish, or the CI timeout has passed since the batch's push, they count toward Batches in CI at once. Its read access also lets Merget read each batch's jobs, so the line under Batches in CI at once says how long each job waited to start; without it, Merget reads the batch's check runs instead. See Batching and Several batches in CI at once.
WorkflowsWrite, when grantedNeeded to land a pull request whose merge writes GitHub Actions workflow content none of your branches has yet, for example when the target branch also changed that workflow file: GitHub refuses an App's push or merge of such content without it. Merget uses it only to land a pull request's own change, merged with your target branch. Without it, Merget hands such a pull request to you to merge on GitHub; a workflow change only the pull request makes, such as an actions version bump, lands without it.
Commit statusesReadReads CI results that are reported as commit statuses.
MetadataReadBasic repository information that GitHub requires for every App.
Members (organization)ReadReads the membership of the GitHub organization the App is installed on, and the members of a team that CODEOWNERS names when Merget checks code-owner review itself. See When Merget lands by push.

Merget itself never writes a file under .github/, a CODEOWNERS, .gitattributes or .gitmodules file: a fix, kept build output and a regenerate command are all refused there on Merget's side. The Workflows permission lets through only a pull request's own workflow change, never a fork's, which a person merges on GitHub. See Security.

Private dependencies

This matters only when Merget's own build is on for the repository; with it off (the default), Merget fetches no private dependency. A regenerate command, which runs with the build on or off, never gets this access.

Private GitHub dependencies need both App access and an explicit grant to the repository that uses them:

  1. Include the dependency repository in the same GitHub App installation as the consuming repository. Use Manage on GitHub in Settings › GitHub, add it under Repository access, and save. The dependency can stay disabled in Merget if you only need it for builds.

  2. Open the consuming repository's settings and expand Advanced › Build and test setup › Dependency access.

  3. Select the dependency under Repository, then choose Grant. GitHub must confirm that you are an Admin of the dependency repository. Opening these controls also needs Maintain or Admin on the consuming repository.

The grant is saved immediately and applies to the next preparation. Save and Cancel in the drawer do not change it. Use Revoke on its row to remove access; see Dependency access for permissions and the effect on later builds.

The token a run gets is read-only. It covers up to 500 dependency repositories in the same installation that the target branch's manifests name and the consuming repository has been granted access to. Selecting All repositories on GitHub does not grant this access by itself. Anyone whose code the setup step runs can use the token while that step runs: a person with Write access, who pushes the code, and a person with Maintain access, through the recipe. Fork pull requests never get it. A bot's pull request gets it only after a maintainer approves the commit, unless the bot is listed under Trusted bots; a run whose predicted base includes a fork or an unapproved pull request receives none. See Credentials used for validation.

Private registries and GitHub Packages cannot use a dependency grant. Give the setup step a credential as a validation secret instead.

Approving a permission change

When the App asks for more permissions than an installation has accepted, GitHub shows a pending request to the account's admins. Merget can't grant permissions for you.

  • Contents: write is needed before a repository can move from Advisory to Queue or Autonomous, or be turned on in either of them. A new repository starts in Queue mode, so turning one on needs it unless you choose Advisory. Without it you see GitHub permission change required; see Enable repositories.

  • Administration: write lets Merget turn off strict protection when an owner confirms, and rename a legacy required check named sema to Merget on its own, in every mode. Without it, follow the links to make the protection change on GitHub. See Branch protection.

  • Actions: write lets Merget cancel CI for batches it no longer needs. The batching settings link to the permission request when it is missing.

  • Members: read lets Merget list the members of a team that CODEOWNERS names, when it checks code-owner review itself. Without it, a pull request whose code owner is a team waits until an owner named individually on that line approves it.

To review a pending request, click Manage on GitHub in Settings › GitHub, or open GitHub's Settings › Applications, find the Merget App and click Configure. Merget picks up accepted permissions on its own. Then go back to the action that needed them and click Try again or Re-check permissions.

What Merget listens to on GitHub

You don't have to tell Merget when something changes. It follows:

  • Pull requests: opened, reopened, new commits pushed, closed or merged, a changed base branch, marked ready for review, or converted to draft.

  • Pushes to your target branch.

  • Check and review results on your pull requests, and review threads being resolved or unresolved, so a batch waiting on review-thread resolution moves as soon as the thread is resolved.

  • Changes to the installation: the App installed, uninstalled, suspended or unsuspended; new permissions accepted; repositories added or removed.

  • Members: read lets GitHub tell Merget at once when someone loses access to an organization's repositories. Without it, or on a personal account, removals apply within an hour; the account's card says so.

Labels and pull request comments have no effect on Merget. Pull request, push, check and review activity in a repository that is turned off in Merget is ignored.

Manage connected accounts

Settings › GitHub lists every installation linked to your organization under Connected GitHub organizations. Everyone in the organization can see it. Each card shows:

  • the GitHub account name and whether it is an Organization or a User;

  • Suspended on GitHub, when GitHub has suspended the App there;

  • the number of repositories, how many are enabled, whether the installation covers all repositories or selected repositories, and when it was linked;

  • which of your own GitHub accounts lets you see its private repositories, for example "You see its private repositories via @octo". When none of them does, the card says so, with Add a GitHub account, which opens the GitHub card of Settings › Account where you add the account you use there. That sentence waits for Merget to finish checking each of your accounts with GitHub, so a card says nothing about your accounts until then.

Actions on each card:

ActionWhoWhat it does
Manage on GitHubEveryoneOpens the installation's settings on GitHub in a new tab.
RefreshEveryoneReads the installation and its repository list from GitHub again.
RemoveOwnersDetaches the installation from this organization (see below).

After Refresh you see a notice such as "acme: 12 repositories synced from GitHub." If the App was uninstalled on GitHub in the meantime, the notice says the account was removed from your organization. If someone moved or removed it while your page was open, the notice says it is no longer connected.

GitHub settings showing a connected example organization and controls to add or find another installation.

Settings › GitHub connects installations to this Merget organization.

What to look for
  • Connected GitHub organizations lists installations already attached here.
  • Add GitHub organization begins installation; the existing-installation section connects one already installed.

Remove a GitHub account

  1. On the account's card, click Remove.

  2. Read the Remove GitHub account dialog and click Remove.

What happens:

  • Every repository of that account is turned off and reset to defaults: Queue mode, the default branch as target branch, analysis and batching settings cleared, agent access back to Findings and graph, and any queue pause cleared.

  • Queued work on those repositories is cancelled, any open batch is abandoned, and any standing merge request is stopped. Runs already in progress finish on their own.

  • The repositories' validation secrets are deleted; organization secrets stay.

  • The Merget App stays installed on GitHub, where it can be removed or linked again. Its access to that account on GitHub continues until you uninstall it there.

The notice afterwards says how many repositories were turned off and reset, and that the App is still installed on GitHub.

Uninstall the App

To disconnect fully, uninstall the App on GitHub: click Manage on GitHub, then use GitHub's uninstall option. When GitHub tells Merget about the uninstall:

  • the account disappears from your organization;

  • queued work on its repositories is cancelled, any standing merge request is stopped, and their validation secrets are deleted;

  • the copies of their code that Merget kept for analysis are erased within minutes (see Data retention).

If you install the App again later, GitHub creates a new installation, which you link as usual.

Suspended installations

A GitHub admin can suspend an App without uninstalling it. While the Merget App is suspended on an account:

  • the card shows Suspended on GitHub;

  • Merget reads no pull requests there and cancels queued work;

  • what members and their agents can still see of those repositories follows the answers Merget already holds, for at most an hour (a public repository's visibility, for at most 24 hours);

  • the Merge Queues page shows GitHub has suspended the Merget App, with an Unsuspend button for each suspended account.

To fix it, unsuspend the App in the installation's settings on GitHub (Manage on GitHub). Reinstalling doesn't lift a suspension. Once it is unsuspended, queues reappear on their own; nothing needs to be reinstalled or turned on again in Merget.

Change which repositories Merget can see

The repositories Merget can see are the ones you selected on GitHub.

  1. In Settings › GitHub, click Manage on GitHub on the account's card.

  2. Under Repository access, choose All repositories or Only select repositories, and add or remove repositories.

  3. Click Save on GitHub.

  4. GitHub brings you back to Merget, which applies the change and shows what changed. If it doesn't, click Refresh on the card.

What happens in Merget:

  • Added repositories appear on the Repositories page, turned off, until someone turns them on.

  • Removed repositories disappear from Merget and their queued work is cancelled. If you add one back later, it stays turned off. One that was turned on when it was removed shows Back on GitHub, previously enabled for 30 days, with Re-enable, which turns it on with its previous mode and settings; its validation secrets were deleted and must be added again.

If every repository Merget was checking was removed on GitHub, Home and Merge Queues say Repositories were removed on GitHub instead of asking you to choose repositories, with the way back: Re-enable repositories when some are back, or Review on GitHub when none is.

Selecting repositories on GitHub only controls what Merget can see. Merget does nothing in a repository until it is turned on. See Enable repositories.