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

# GitHub integration

> Investigate GitHub issues and propose end-to-end tests on pull requests.

Connect Lark to GitHub to do two things from your repos:

* **Investigate issues** — Comment `/investigate` on a GitHub issue and Lark posts a structured investigation report back on the thread.
* **Propose tests on PRs** — Add `.github/workflows/lark.yml` so Lark can propose new end-to-end tests when pull requests open.

## Setup

1. Open **Settings → Integrations** in the [dashboard](https://dashboard.getlark.ai/settings/integrations).
2. Click **Connect** on the GitHub card.
3. Install the Lark GitHub App and choose which repositories Lark can access.
4. After install, open **Configure → Manage repos** to add `.github/workflows/lark.yml` to each repo you want test proposals on.

### Add `lark.yml` to a repo

On the **Finish GitHub setup** page, click **Add lark.yml** for a repo. GitHub opens with the workflow file prefilled — review and commit it in your browser.

Each repo also needs an `ANTHROPIC_API_KEY` secret under **Settings → Secrets and variables → Actions**. Lark uses your key, so token spend goes to your Anthropic account. You can add the secret before or after committing the workflow file; the action skips with a friendly comment until the secret is set.

Repos show as **Connected** automatically after the first pull request triggers the workflow.

## Investigate issues

On any connected repository, a user with write access (owner, member, or collaborator) can comment:

```
/investigate
```

Lark reads the issue title, body, labels, and comment thread, runs an investigation, and posts the report back as a GitHub comment. While the investigation runs, Lark adds a `lark:investigating` label; when it finishes, that label is replaced with `lark:investigated` or `lark:investigation-failed`.

<Note>
  `/investigate` works on issues only, not pull requests. Comments from first-time or untrusted contributors are ignored.
</Note>

If `/investigate` is posted again while an investigation is already running for that issue, Lark skips the duplicate.

## Propose tests on pull requests

When `.github/workflows/lark.yml` is present, Lark runs on pull requests that are **opened** or **reopened**. It analyzes the diff and can propose new end-to-end tests for the changes.

Pull requests from forks are skipped — forked workflows cannot mint OIDC tokens with Lark's trusted audience.

## Reconfiguring or disconnecting

Click **Configure** on the GitHub card to review connected repos or open **Manage repos** to add `lark.yml` to more repositories.

Click **Disconnect** to remove the Lark GitHub App installation from your account. Lark stops responding to `/investigate` and test proposals stop running; existing GitHub comments and workflow files in your repos are left untouched.
