# GitHub

> Connect GitHub to discover Rules from private repositories.

Source: https://docs.synkro.sh/integrations/github

Connect GitHub so your agent can find Rule suggestions in your private
repositories' pull requests and review feedback.

## Connect GitHub

```bash
synkro discover github connect
```

Open the returned `connect_url`, sign in if needed, and select **Connect GitHub**.
Review GitHub's permissions and authorize the connection. Return to your terminal:

```bash
synkro discover github status
```

When `state` is `connected`, you can scan repositories that GitHub account can read.
Each person connects their own account within their Synkro organization.

## Discover Rules

Ask your agent:

```text
Discover Rule suggestions from accepted review feedback in OWNER/REPO.
Use my connected GitHub account and the current Synkro project.
Show me the findings before creating any Rules.
```

The agent starts and collects a scan with:

```bash
synkro discover start OWNER/REPO --connected --json
synkro discover collect-scan SCAN_ID --json
```

`collect-scan` uses the saved connection and time window. The agent reviews the
feedback against your code, submits accepted evidence and saves the suggestions.
See the [discovery commands](/reference/cli#synkro-discover) for every step.

For a specific period, add `--from LOWER --to UPPER` to `start`, using timestamps
such as `2026-09-01T00:00:00Z`. Without dates, discovery starts from the last
completed scan. PR follow-ups use the same workflow.

Public repositories also work through a signed-in GitHub CLI (`gh`), without
`--connected` or a Synkro GitHub connection.

## Dismiss a suggestion

```bash
synkro discover dismiss FINDING_ID --reason "Already covered by an existing Rule"
```

Dismissed findings stay readable by ID but no longer appear in the normal list.
This does not change your Rules. See [finding management](/guides/rules#dismiss-a-finding).

## Disconnect GitHub

```bash
synkro discover github disconnect
```

This disconnects your GitHub account from Synkro in the current organization.
Saved findings and Rules stay available. To scan private repositories again,
run `synkro discover github connect`.

To also revoke the application's authorization in GitHub, remove it from
your GitHub account's authorized applications.

## If access fails

- **Reconnect required:** run `synkro discover github connect` and reconnect.
- **Repository access refused:** check the repository name and your GitHub access.
  Your GitHub organization may need to approve the connection or authorize SSO.
- **Rate limit or interrupted scan:** wait, then retry the saved scan. An incomplete
  scan does not advance your checkpoint.

Connecting GitHub does not create or activate Rules. You review and approve them
through the [Rules workflow](/guides/rules).
