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

# GitHub Integration

> Connect GitHub repositories for code ownership, change tracking, and incident context

<div aria-hidden="true" style={{position:"absolute",width:"1px",height:"1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap"}}>For LLM agents: documentation index at <a href="/llms.txt" tabIndex={-1}>/llms.txt</a>, full text at <a href="/llms-full.txt" tabIndex={-1}>/llms-full.txt</a>. Append .md to any page URL for plain markdown.</div>
Connect your GitHub repositories to AnomalyArmor to monitor code ownership, track changes to data pipelines, and get incident context when alerts fire. AnomalyArmor analyzes your repos for CODEOWNERS files, git blame history, and table references so you can route alerts to the right people.

## What AnomalyArmor Does with Your Repos

Once connected and monitored, AnomalyArmor scans your repositories for:

* **CODEOWNERS files** to map directories and files to team owners
* **Git blame data** to identify who last modified SQL models, dbt files, and pipeline code
* **Table references** in SQL files to link code to monitored data assets
* **Change correlation** to show recent code changes when data quality issues arise

This lets AnomalyArmor automatically suggest alert owners, show who to contact when a table breaks, and provide code-level context for schema changes and freshness incidents.

## GitHub App vs OAuth: Which to Choose

AnomalyArmor supports two connection methods. For most teams, the GitHub App is the better choice.

|                     | GitHub App                                | OAuth App                       |
| ------------------- | ----------------------------------------- | ------------------------------- |
| **Setup**           | One-click install from GitHub Marketplace | Personal OAuth flow             |
| **Permissions**     | Scoped to selected repos only             | Access to all repos you can see |
| **Token lifecycle** | Auto-refreshing, no expiry                | Permanent until revoked         |
| **Webhooks**        | Automatic push event webhooks             | Manual per-repo webhook setup   |
| **Best for**        | Teams, production use                     | Quick personal testing          |
| **Identity**        | Org-level installation                    | Individual user account         |

<Tip>
  **Use the GitHub App** if you're setting this up for a team. It provides granular repo-level permissions and automatic webhook delivery for real-time sync.
</Tip>

## Setup: GitHub App (Recommended)

<Steps>
  <Step title="Open Git Settings">
    Go to **Settings > Git Integration** in AnomalyArmor.
  </Step>

  <Step title="Install GitHub App">
    Click **Install GitHub App**. You'll be redirected to GitHub to authorize the AnomalyArmor app.
  </Step>

  <Step title="Select repositories">
    Choose which repositories to grant access to. You can select all repos or pick specific ones.
  </Step>

  <Step title="Monitor repos">
    Back in AnomalyArmor, your accessible repos appear automatically. Toggle **Monitor** on for each repo you want to analyze. AnomalyArmor immediately starts scanning for code ownership data.
  </Step>
</Steps>

## Setup: OAuth App

<Steps>
  <Step title="Open Git Settings">
    Go to **Settings > Git Integration** in AnomalyArmor.
  </Step>

  <Step title="Connect with OAuth">
    Click **Connect with OAuth**. You'll be redirected to GitHub to authorize AnomalyArmor.
  </Step>

  <Step title="Monitor repos">
    Your accessible repos appear automatically. Toggle **Monitor** on for each repo you want to analyze.
  </Step>
</Steps>

<Note>
  OAuth tokens are tied to your personal GitHub account. If you leave the organization, the connection breaks. For team setups, use the GitHub App instead.
</Note>

## Monitoring Repos

The Monitor toggle controls whether AnomalyArmor actively analyzes a repository:

* **Toggle ON**: Creates a repository record and triggers initial analysis (CODEOWNERS parsing, git blame, table reference scanning). The Status column shows progress (Pending, Running, Synced, or Failed).
* **Toggle OFF**: Pauses monitoring. All existing analysis data is preserved. You can re-enable at any time.

### Linking Assets to Repos

For the richest analysis, link your monitored repos to data assets (databases). Click the link icon next to a monitored repo's status to open the asset linking dialog. This lets AnomalyArmor correlate code changes in the repo with specific tables in your database.

## Webhooks

### GitHub App

Webhooks are configured automatically when you install the app. AnomalyArmor receives push events in real time and re-analyzes monitored repos when relevant files change (CODEOWNERS, SQL files, dbt models).

### OAuth App

OAuth connections do not include automatic webhooks. AnomalyArmor relies on periodic re-sync to pick up changes. You can manually trigger a re-sync from **Settings > Git Integration** by clicking **Re-sync**.

## Common Questions

### Should I use the GitHub App or OAuth to connect?

Use the GitHub App for team or organization installs: it delivers webhooks automatically so AnomalyArmor re-syncs on push, gives you fine-grained per-repo access control, and uses a refreshing token that never expires. Use OAuth only for personal-account trials or temporary single-user connections, or when your organization blocks third-party GitHub Apps. You can switch later without losing monitored repo data.

### Does AnomalyArmor read my source code?

AnomalyArmor analyzes CODEOWNERS, commit history, and references to your monitored tables (typically in SQL files and dbt models). It does not read or store full source code. The repo connection is for ownership and change context, not for code execution.

### Does the GitHub integration support private repositories?

Yes. Both GitHub App and OAuth connection methods support private repos. For GitHub App, grant access to the specific repos during installation. For OAuth, your authorized scopes must include private repo read access.

### Why does my integration show 'No repositories found' after connecting?

For GitHub App: confirm you granted access to at least one repo during install (check the installed GitHub Apps list in your org settings). For OAuth: private repos in orgs with SAML SSO require explicit SSO authorization on the token.

### How do I disconnect or change which repositories AnomalyArmor can see?

For GitHub App, open your GitHub organization settings, find AnomalyArmor under Installed GitHub Apps, and edit the repo access list. Then click **Re-sync** in AnomalyArmor to refresh. For OAuth, click **Disconnect** in the Git Integration settings and reconnect. Previously monitored repositories and their analysis data are preserved across disconnect/reconnect.

## Troubleshooting

### "No repositories found" after connecting

* **GitHub App**: Check that you granted access to at least one repository during installation. Go to your GitHub organization settings, find the AnomalyArmor app under **Installed GitHub Apps**, and verify the repository access list.
* **OAuth**: Verify that your GitHub account has access to the repositories you expect. Private repos in organizations may require SSO authorization.

### Connection shows "Pending Setup"

The OAuth flow was started but not completed. Click **Complete Setup** to finish the authorization.

### Permissions seem wrong after changing repo access

If you change which repos the GitHub App can access (in GitHub's settings), click **Re-sync** in AnomalyArmor to refresh the repository list.

### Need to start over

Click **Disconnect** in the Git Integration settings, then reconnect using either method. Your previously monitored repositories and their analysis data are preserved.

## Next Steps

<CardGroup cols={2}>
  <Card title="GitHub Actions" icon="play" href="/integrations/github-actions">
    Run quality checks in CI/CD
  </Card>

  <Card title="dbt Integration" icon="database" href="/integrations/dbt">
    Connect dbt project metadata
  </Card>

  <Card title="Alert Destinations" icon="bell" href="/alerts/overview">
    Route alerts to the right team
  </Card>

  <Card title="Data Sources" icon="server" href="/data-sources/overview">
    Connect your data warehouse
  </Card>
</CardGroup>
