# Connect GitHub with a token

> If you can't install the InfraNest Automations app, connect GitHub with a personal access token so your automations can still act on GitHub.

Source: https://infranest.io/docs/connect-github-with-a-token
Last updated: 2026-10-26

---

Use this if you can't install the InfraNest Automations app on GitHub — a personal access token lets your automations act on GitHub as a fallback. This article is for anyone connecting GitHub without app access.

## Overview
- A token lets InfraNest automations act on GitHub (open issues, run workflows, merge pull requests, set statuses, and more).
- Installing the app is still the recommended way — see **Connect GitHub**. A token is a fallback for when your GitHub account or organisation doesn't allow installing apps.
- With a token, GitHub events (pushes, pull requests, workflow runs, releases) can't start your automations — only the app can hear about those.
- A token reaches every repository you can access, rather than just the ones you pick, and it expires and needs replacing.

> [!NOTE]
If you choose a GitHub trigger while only a token is connected, the automation builder will warn you, since tokens can't start automations.

## Create the token on GitHub
1. On the GitHub connect screen in InfraNest, under **API token**, select **Open the token page**. GitHub opens a new classic token named *InfraNest*, with the **repo** scope already ticked.
   To do it by hand instead: on GitHub, open **Settings → Developer settings → Personal access tokens → Tokens (classic)**, select **Generate new token (classic)**, name it and tick **repo**.
2. Choose an expiry date.
3. Select **Generate token** and copy it. GitHub shows it only once.

> [!WARNING]
If your organisation uses single sign-on (SAML) on GitHub, next to the token select **Configure SSO** and **Authorize** it for that organisation. Without this step, GitHub refuses the token for the organisation's repositories.

## Connect it in InfraNest
1. Go to **Integrations** and open **GitHub**.
2. Select **Connect** (or **Add account** if you've already connected one).
3. Under **API token**, paste the token into **Personal access token** and select **Connect**.

<!-- screenshot: connect-github-token -->

<!-- docs-screenshots:start:connect-github-token -->

![Connect GitHub with a token](/media/30b05a6d-20b5-4aed-babd-48c7f00b2d8c)

<!-- docs-screenshots:end:connect-github-token -->

InfraNest checks the token with GitHub before saving it. The connection then appears under **Accounts** with your GitHub username.

## Use it in an automation
1. In the automation builder, add any GitHub action under **Do this**.
2. Choose this connection.
3. Fill in the repository fields — they'll suggest the repositories your token can reach.

With a token, the team picker can't list your organisation's teams, so requesting a review from a team is easiest with the app installed on the organisation. Requesting reviews from people works either way.

## Replace an expiring token
GitHub emails you before a token expires. After the expiry date, the GitHub steps in your automations fail until you replace it.

1. Create a new token on GitHub, as described above.
2. Connect it in InfraNest. It shows up as a second account.
3. In each automation that uses GitHub, choose the new connection in its GitHub steps and save.
4. Disconnect the old one.

## Disconnect
1. Open **GitHub** in **Integrations**.
2. Go to **Accounts**.
3. Select **Disconnect** next to the token connection.

This removes the token from InfraNest, but it doesn't delete it on GitHub: delete it there yourself under **Settings → Developer settings → Personal access tokens**.

## Tips
- InfraNest works with GitHub.com. GitHub Enterprise Server (self-hosted GitHub) isn't supported.
- Your token is stored securely and never shown again.
- Anything an automation does on GitHub is done as you, so it appears under your name on GitHub.
