> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tembo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub

> Connect GitHub to Tembo on Kubernetes with a GitHub App created from the install notes.

Tembo connects to GitHub through a GitHub App you create for your install. After you [install](https://docs.tembo.io/features/self-hosted/kubernetes/install.md) the chart, its notes link to GitHub's form with every setting filled in. You create the app, store its credentials in a Kubernetes Secret, and Tembo reads them from there.

Before you begin, you need:

* Tembo installed, with release `tembo` in namespace `tembo` in the examples.
* To create the app under a GitHub organization: owner or GitHub App manager of that organization.

***

## Step 1: Create the GitHub App

Print the install notes:

```bash theme={null}
helm get notes tembo -n tembo
```

Under **GitHub**, open the link. It goes to GitHub's **New GitHub App** form with your install's URLs, permissions and events filled in. Click **Create GitHub App**; if GitHub says the name is taken, change it.

The link creates the app under your personal GitHub account. To create it under an organization, first set the organization in your values and [apply the change](https://docs.tembo.io/features/self-hosted/kubernetes/configuration.md#apply-changes), then print the notes again:

```yaml theme={null}
github:
  organization: <your-github-org>
```

The form uses the webhook secret the chart generated. If GitHub can't reach your install, for example on an internal network, see [Public API host](https://docs.tembo.io/features/self-hosted/kubernetes/networking.md#public-api-host).

> [!NOTE]
>
> For Dependabot alert triggers, also give the app the **Dependabot alerts** permission and the **Dependabot alert** event (see [Permissions](https://docs.tembo.io/features/self-hosted/integrations/github.md#permissions)).

***

## Step 2: Generate a client secret and a private key

On the app's settings page:

1. Under **Client secrets**, click **Generate a new client secret** and copy it. GitHub shows it only once.
2. Under **Private keys**, click **Generate a private key**. GitHub downloads a `.pem` file.

Also note the **App ID**, the **Client ID**, and the app's slug, from its URL `https://github.com/apps/<app slug>`.

***

## Step 3: Give Tembo the credentials

Store them in a Secret. Replace each `<...>`, including the angle brackets:

```bash theme={null}
APP_SLUG=<app slug>
BOT_ID=$(curl -s "https://api.github.com/users/${APP_SLUG}%5Bbot%5D" | jq -r .id)
read -s GITHUB_APP_CLIENT_SECRET
kubectl create secret generic tembo-github-app \
  --namespace tembo \
  --from-literal=appId=<App ID> \
  --from-literal=appName="$APP_SLUG" \
  --from-literal=clientId=<Client ID> \
  --from-literal=clientSecret="$GITHUB_APP_CLIENT_SECRET" \
  --from-literal=clientUserEmail="${BOT_ID}+${APP_SLUG}[bot]@users.noreply.github.com" \
  --from-file=privateKey=<path to the .pem file> \
  --dry-run=client --output yaml | kubectl apply --filename -
unset GITHUB_APP_CLIENT_SECRET
```

Check that `BOT_ID` is a number: `null` means the slug is wrong. Tembo's commits are attributed to `clientUserEmail`.

Then reference the Secret in your `values.yaml`, and [apply the change](https://docs.tembo.io/features/self-hosted/kubernetes/configuration.md#apply-changes) with `helm upgrade`:

```yaml theme={null}
github:
  organization: <your-github-org> # if you set it in Step 1
  existingSecret: tembo-github-app
```

> [accordion] All Secret keys
>
> | Key | Value |
> | - | - |
> | `appId` | The app's **App ID** |
> | `appName` | The app's slug |
> | `clientId` | The app's **Client ID** |
> | `clientSecret` | The client secret from Step 2 |
> | `privateKey` | The contents of the `.pem` file from Step 2 |
> | `webhookSecret` | Optional. Leave it out to use the one the chart generates |
> | `clientUserEmail` | `<bot user ID>+<app slug>[bot]@users.noreply.github.com` |
> | `clientUserName` | Optional. Defaults to `<app slug>[bot]` |
>
> Values in the Secret override the same keys under `github` in your Helm values. To render the chart with `helm template`, see [GitOps](https://docs.tembo.io/features/self-hosted/kubernetes/configuration.md#gitops-and-helm-template).

***

## Step 4: Connect GitHub

Once you've signed in to Tembo, connect GitHub from Tembo, not from GitHub: Tembo only accepts an installation that starts in Tembo.

1. In Tembo, go to **Settings > Integrations** and connect GitHub.
2. Choose the organization or account, and **All repositories** or specific ones, then click **Install** and authorize the app.
3. Enable the repositories Tembo should work on. You can change them later in **Settings > Repositories**.

To connect a GitHub organization, you need to be one of its owners; otherwise GitHub sends the owners an installation request.

To check webhook deliveries, open the app's **Advanced** tab on GitHub.

This connects repositories. To let users sign in with GitHub or connect personal accounts, see [GitHub sign-in](https://docs.tembo.io/features/self-hosted/kubernetes/authentication.md#github-sign-in-and-connected-accounts).

***

## Create the app by hand

Use this if you can't read the install notes, for example when a GitOps tool renders the chart. Open **New GitHub App**: `https://github.com/organizations/<your-org>/settings/apps/new` for an organization, or **GitHub > Settings > Developer settings > GitHub Apps > New GitHub App** for your account. Fill in:

| Setting | Value |
| - | - |
| **GitHub App name** | Any name, e.g. `Tembo (tembo.example.com)` |
| **Homepage URL** | `https://<your-host>` |
| **Callback URL** | `https://<your-host>/api/oauth/github/callback` |
| **Request user authorization (OAuth) during installation** | Checked |
| **Webhook URL** | `https://<your-host>/api/webhook/github` |
| **Webhook secret** | A random string, e.g. from `openssl rand -hex 32` |
| **Permissions** and **events** | As listed in [Permissions](https://docs.tembo.io/features/self-hosted/integrations/github.md#permissions) and [Subscribe to events](https://docs.tembo.io/features/self-hosted/integrations/github.md#subscribe-to-events) |

Then continue from Step 2, and add your webhook secret to the Secret in Step 3 as `webhookSecret`.

***

## Rotate credentials

1. Generate a new client secret or private key on the app's settings page.
2. Update the Secret with the same `kubectl create secret ... | kubectl apply` command.
3. [Apply the change](https://docs.tembo.io/features/self-hosted/kubernetes/configuration.md#apply-changes) with `helm upgrade`, and wait for the controller to replace the agent hosts.
4. Delete the old client secret or private key on GitHub.

## Next

> [card] [Slack and others](https://docs.tembo.io/features/self-hosted/kubernetes/integrations/overview.md#slack-and-others)
>
> Connect Slack, Linear, Jira and more.

***

## Need Help?

If you run into any issues, contact [support@tembo.io](mailto:support@tembo.io).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.