# GitHub App for On-Prem

On-Prem installation requires a GitHub App. This page describes how to create one for your on-prem setup.

## Prerequisite

* You need to have the privilege to create a GitHub App and authorize the app for your repositories.
* A domain name that will be used for your on-prem installation.

## Variable definitions

`$GITHUB_URL`: Hostname where GitHub is hosted

`$AV_HOSTNAME`: Hostname where Aviator is hosted (e.g. `aviator.example.com`)

`$GITHUB_APP_ID`: ID generated when a GitHub app is created

`$MERGEQUEUE_PEM_FILE`: Private key generated by GitHub for Aviator

## Steps

### Step 1

Go to GitHub Developer settings and Click “New GitHub App”.

<figure><img src="/files/tGgGwbS9p5a5rG3MMeSo" alt=""><figcaption><p>Click Developer settings on the Settings page</p></figcaption></figure>

<figure><img src="/files/l6msklsHpWx5jbNIesP0" alt=""><figcaption><p>Click New GitHub App button</p></figcaption></figure>

The developer settings can be found through your user settings or url of the format:`https://$GITHUB_URL/settings/apps`

Use the following settings to create the app:

**GitHub App name:** Aviator

**Description:** Automate merge workflows for GitHub, manage queues in teams and improve code quality.

**Homepage URL:** [<mark style="color:blue;">https://aviator.co/</mark>](https://aviator.co/)

**Callback URL:** `https://$AV_HOSTNAME/login/oauth/callback/github`

**Expire user authorization tokens**: YES

**Request user authorization (OAuth) during installation**: NO

**Enable Device Flow**: NO

**Setup URL:** `https://$AV_HOSTNAME/api/setup/complete`

**Redirect on update**: YES

**Webhook**

**Active**: YES

**Webhook URL:** `https://$AV_HOSTNAME/api/webhook`

**Webhook Secret:** Optional. If you setup Webhook secret, you should also define set that at `GITHUB_WEBHOOK_SECRET` to validate webhook signature.

**Permissions:**

{% hint style="warning" %}
***Please review the following carefully, any mismatch here could result in unexpected behavior of the app.***
{% endhint %}

Repository permissions

<table><thead><tr><th width="364">Name</th><th>Access</th></tr></thead><tbody><tr><td>Administration</td><td>Read-only</td></tr><tr><td>Checks</td><td>Read and write</td></tr><tr><td>Commit statuses</td><td>Read-only</td></tr><tr><td>Contents</td><td>Read and write</td></tr><tr><td>Issues</td><td>Read and write</td></tr><tr><td>Metadata</td><td>Read-only</td></tr><tr><td>Pull requests</td><td>Read and write</td></tr><tr><td>Workflows</td><td>Read and write</td></tr></tbody></table>

Organization permissions

| Name    | Access    |
| ------- | --------- |
| Members | Read-only |

**Subscribe to events**:

Check the following

* Branch Protection rules
* Check Run
* Check Suite
* Issue Comment
* Label
* Member
* Membership
* Public
* Pull request
* Pull request review
* Pull request review comment
* Pull request review thread
* Push
* Repository
* Status
* Team
* Workflow run

**Where can GitHub App be installed**: Any account

After creating the GitHub app, you can add a logo. Find a copy of Aviator Logo in the attached assets.

### Step 2

From the GitHub app page for Aviator, take a note of the App ID specified on the top. This is your `$GITHUB_APP_ID`.

![](/files/PNIWfJgHJLuWm5e0Xr9S)

### Step 3

Generate a private key from the bottom of the page. This is your `$MERGEQUEUE_PEM_FILE`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aviator.co/manage/on-premise-installation/github-app-for-on-prem.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
