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

# GitHub integration

> Connect GitHub and configure the PR gate to run tests on pull requests

Setting up GitHub integration lets Decipher run tests automatically when pull requests are opened or updated.

## Step 1: Open Integrations

<Steps>
  <Step title="Go to Settings">
    In Decipher, go to **Settings** (or **Integrations**, depending on your nav).
  </Step>

  <Step title="Find GitHub">
    Find the **GitHub** section.
  </Step>
</Steps>

## Step 2: Connect GitHub

<Steps>
  <Step title="Start the connection">
    Click **Connect** next to GitHub. You'll be sent to GitHub to install the Decipher app.
  </Step>

  <Step title="Choose where to install">
    On GitHub, choose where to install the app:

    * **Your user account** — you'll see repos from your personal account
    * **An organization** — you'll see repos from that org
  </Step>

  <Step title="Complete the install">
    Complete the install (and any permission prompts). You'll be redirected back to Decipher. GitHub is now **connected** for your org.
  </Step>
</Steps>

## Step 3: Connect a repository

<Steps>
  <Step title="Select a repo">
    In the GitHub section, use the **repository** dropdown (it lists repos from the account/org you chose). Select the repo you want to run PR tests for (e.g. `your-org/your-repo`).
  </Step>

  <Step title="Connect">
    Click **Connect repository**. Decipher will create a webhook on that repo and save the connection. You should see **Connected to owner/repo**.
  </Step>
</Steps>

<Note>
  If you don't see the right repos: The list is for the account/org you installed the app on. To use a different one, click **Use a different GitHub account or org**, then install again and choose the correct account/org.
</Note>

## Step 4: Configure PR Gate

With a repo connected, click **Configure PR Gate**.

### Optional – Branch scope

Add **base branches** (e.g. `main`, `develop`). Tests run only for PRs whose base branch is in this list. Leave empty to allow all branches.

### When a PR is opened or reopened

Choose one or more **Suites** and/or **Tests** to run.

Click **Save**.

## What happens on PRs

* When someone **opens or reopens** a PR (and, if you set branch scope, the base branch matches) or **pushes a new commit** to an existing PR, Decipher runs the suites/tests.
* Decipher waits for a preview deployment (e.g. from Vercel or Netlify) for that PR, then runs the tests against that preview URL.
* When runs finish, Decipher **posts a comment on the PR** with the test results.

## Disconnecting or changing repo

* **Disconnect the repo only** — Use the small **X** next to **Connected to owner/repo**. You can then pick another repo and connect it.
* **Disconnect GitHub entirely** — Click **Disconnect** in the GitHub section. This removes the connection and the webhook; you can connect again later and choose a different account/org or repo.

***

*Need help? [Contact our support team](mailto:team@getdecipher.com).*
