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

# Let QA Wolf read your code on GitHub

> Turn on code access through the QA Wolf Code GitHub App, so QA Wolf's AI reads the code in the repositories you choose.

Code access lets QA Wolf's AI read the code in the repositories that you choose on GitHub. You turn it on when you connect GitHub through the QA Wolf Code app.

QA Wolf has two GitHub Apps. A workspace connects through one of them, never through both.

| App | What QA Wolf does |
| - | - |
| QA Wolf | Tests your deployments and pull requests, and posts the results as checks and comments. |
| QA Wolf Code | Everything that the QA Wolf app does, and reads your code. |

With code access, QA Wolf's AI uses your code changes to find new features, create flows, and maintain flows. It also helps tell when a failure is a bug.

QA Wolf never writes code. The app has read access to repository contents.

## Requirements

* Code access turned on for your workspace. Ask your QA Wolf representative to turn it on. Until then, the GitHub settings have no **Read your code** option.
* An organization admin in QA Wolf. Other members see the state and the note "Only an organization admin can change this."
* An owner of the GitHub organization that installs the app. For a personal account, the owner of that account.

## Turn on code access for a new connection

**Step 1**

Open **Workspace settings → Integrations** and select **Connect** on the GitHub card.

**Step 2**

In the **Connect GitHub** dialog, keep **Read your code** selected, then select **Continue to GitHub**.

**Step 3**

In GitHub, install the QA Wolf Code app and choose the repositories.

**Step 4**

Authorize the app when GitHub asks. GitHub then returns you to QA Wolf.

If you clear **Read your code**, GitHub asks you to install the QA Wolf app, and code access stays off. You can change the repositories and code access later.

## Turn on code access for a workspace on the QA Wolf app

**Step 1**

Open **Workspace settings → Integrations**. Open the GitHub card's menu and select **Configure**.

**Step 2**

Under **What QA Wolf does**, find "Read your code (off)" and select **Turn on**.

**Step 3**

In GitHub, install the QA Wolf Code app and choose the repositories.

**Step 4**

Authorize the app when GitHub asks.

**Step 5**

[Update your required status checks](#update-required-status-checks) in GitHub.

QA Wolf Code replaces the QA Wolf app. QA Wolf removes the installation of the QA Wolf app after it links the new one, unless another workspace still uses that installation.

## Update required status checks

A required status check in GitHub can name the app that must post it. After the change, QA Wolf Code posts the checks, so a rule that names the QA Wolf app stops matching.

> [!WARNING]
>
> Until you update the rule, a pull request waits for a check that never comes.

**Step 1**

In GitHub, open the branch protection rule or the ruleset of each protected branch.

**Step 2**

Find each required status check that names the QA Wolf app as its source.

**Step 3**

Change the source to QA Wolf Code, or to any source.

Do the opposite when you turn code access off.

## Turn off code access

**Step 1**

Open **Workspace settings → Integrations**. Open the GitHub card's menu and select **Configure**.

**Step 2**

Under **What QA Wolf does**, select **Turn off**.

**Step 3**

In GitHub, install the QA Wolf app and choose the repositories.

**Step 4**

Authorize the app when GitHub asks.

**Step 5**

Change each required status check that names QA Wolf Code.

The QA Wolf app can't read your repositories, only the changes in pull requests. QA Wolf's AI then stops reading your code. Testing keeps working.

## Permissions of QA Wolf Code

QA Wolf Code has every permission of the QA Wolf app, plus three: `contents: read`, `actions: write`, and `members: read`. GitHub shows these permissions when you install the app.

| Permission | What QA Wolf uses it for |
| - | - |
| `contents: read` | Reads the code in the repositories you choose. |
| `actions: write` | Starts and cancels a workflow run in your repository, for a feature that is in limited release. It can't change code. |
| `members: read` | Checks that the person who connects the app is an owner of the GitHub organization. |
| `checks: write` | Posts the results of your flows as check runs. |
| `statuses: write` | The QA Wolf app has this permission, and QA Wolf Code keeps it. |
| `issues: write` | Files a bug report as a GitHub issue, updates the issue, and posts comments. |
| `pull_requests: write` | Replies to comments on pull requests. Opens a pull request for the feature that is in limited release. |
| `repository_hooks: write` | Deletes the repository webhooks that QA Wolf created until 2024, when you disconnect GitHub. |
| `deployments: read` | Receives the status of each deployment, which starts your flows. |
| `metadata: read` | Required by GitHub for every app. |

The app subscribes to these events: `deployment_status`, `issue_comment`, `issues`, `pull_request`, `pull_request_review_comment`, `push`, `status`, and `workflow_run`.

| Event | What QA Wolf does with it |
| - | - |
| `deployment_status` | Starts the flows of a deployment. |
| `pull_request` | Records the pull request and its changes. |
| `issue_comment`, `pull_request_review_comment` | Reads a comment that mentions `@qawolf`. |
| `push` | Learns when you add or change the workflow of the feature that is in limited release. |
| `workflow_run` | Follows the workflow run that QA Wolf started for that feature. |

GitHub also sends `installation` and `check_suite` to the app without a subscription. QA Wolf uses `installation` to record a removed or suspended app, and `check_suite` to record the head commit of a check suite.

## Approve the new permission

If your organization installed QA Wolf Code before it asked for the `actions` permission, GitHub asks an organization owner to approve it. Until an owner accepts, QA Wolf can't use that permission, and the feature that needs it doesn't work.

In GitHub, an owner opens the organization's installed GitHub Apps, opens QA Wolf Code, and accepts the new permissions.

## States of code access

| What you see | What to do |
| - | - |
| "Read your code (off)" with **Turn on**. | Turn on code access when you want it. |
| "Read your code" with **Turn off**. | Nothing. Code access is on. |
| "GitHub suspended QA Wolf Code. Unsuspend it on GitHub to restore code access." | Ask an owner to unsuspend the app in the GitHub organization's settings. |
| "QA Wolf Code can't read your GitHub organization membership. Ask an owner of the organization to accept QA Wolf Code's updated permissions on GitHub, then connect again." | Ask an owner to accept the updated permissions in GitHub, then connect again. |
| "Only an owner of the GitHub organization that installed QA Wolf Code can connect it." | Ask an owner of the GitHub organization to connect the app. |
| "The GitHub authorization expired. Connect GitHub again." | Connect GitHub again. |
| "Code access could not be loaded." with **Retry**. | Select **Retry**. |

While GitHub has the app suspended, it sends QA Wolf no events, so the tests of deployments and pull requests also stop.


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