Connecting Repositories
Learn how to connect, configure, and manage your GitHub repositories in FlagShark.
FlagShark monitors your GitHub repositories for feature flag activity. This guide covers how to connect new repositories, configure monitoring settings, and manage existing connections.
Adding Repositories
During Initial Setup
When you first install FlagShark, you'll choose which repositories to monitor:
- All repositories - Automatically monitors all current and future repos
- Select repositories - Choose specific repos to monitor
Adding Repositories Later
To add more repositories after initial setup:
- Go to Settings → Repositories in the FlagShark dashboard
- Click "Add Repositories"
- Select the repositories you want to add
- Click "Save"

If you don't see a repository you expect:
- Ensure the FlagShark GitHub App has access (check GitHub App settings)
- Verify you have admin access to the repository
- The repository must be in an organization or account where FlagShark is installed
Repository Settings
Each repository can have individual settings that override workspace defaults.
Detection Settings
Configure how FlagShark detects flags in each repository:
| Setting | Description | Default |
|---|---|---|
| Enabled | Whether to monitor this repository | true |
| Default branch | Branch to compare PRs against | main |
| Stale threshold | Days before a flag is considered stale | 30 |
| Auto-cleanup | Create cleanup PRs automatically | false |
Custom Configuration
For repository-specific flag patterns, create a .flagshark.yaml file in the repository root. See Configuration for details.
Repository Status
Each repository shows its current status in the dashboard:
| Status | Meaning |
|---|---|
| Active | Monitoring enabled, receiving webhooks |
| Paused | Monitoring temporarily disabled |
| Error | Configuration issue or missing permissions |
| Pending | Initial scan in progress |
Screenshot needed: Repository list showing status badges (Active, Paused, Error) next to each repository namedashboard → repository-status-badges
Scanning Existing Code
When you track a repository, FlagShark automatically scans the existing code for feature flags.
Automatic Initial Scan
When you enable tracking for a repository:
You can track the scan progress in real-time via the dashboard.
Manual Re-scans
You can also trigger a manual scan at any time:
- Go to the repository page in the FlagShark dashboard
- Click "Scan Repository"
- Wait for the scan to complete (typically 1-5 minutes depending on repo size)
Manual scans are useful if you:
- Want to re-sync your flag inventory
- Suspect some flags weren't detected
- Added FlagShark after significant codebase changes
The scan will:
- Analyze all files in the default branch
- Detect existing feature flags
- Update your flag inventory
Scan Limitations
- Scans only analyze the default branch
- Historical flag additions/removals won't have associated PRs
- Large repositories (>10,000 files) may take longer
Working with Monorepos
FlagShark supports monorepo architectures. For large monorepos:
Path-Based Filtering
Configure which paths to monitor in your .flagshark.yaml:
# Only scan specific directories
include_paths:
- "packages/web/**"
- "packages/api/**"
# Exclude paths
exclude_paths:
- "packages/legacy/**"
- "**/test/**"
Team Ownership
Map paths to teams for better organization:
ownership:
- paths: ["packages/checkout/**"]
team: "payments"
- paths: ["packages/auth/**"]
team: "identity"
Removing Repositories
To stop monitoring a repository:
From FlagShark
- Go to Settings → Repositories
- Find the repository
- Click the menu (⋮) → Remove
This removes the repository from FlagShark but keeps the GitHub App installed.
From GitHub
- Go to GitHub → Settings → Applications → FlagShark
- Click Configure
- Deselect the repository
This removes FlagShark's access to the repository entirely.
Troubleshooting
Repository Not Appearing
If a repository doesn't appear in FlagShark:
- Check GitHub App installation - Verify FlagShark has access in GitHub settings
- Verify permissions - You need admin access to add repositories
- Check organization settings - Some orgs require approval for new app installations
Webhooks Not Firing
If FlagShark isn't detecting PRs:
- Check repository status - Look for "Error" status in the dashboard
- Verify webhook delivery - Check GitHub webhook settings for delivery failures
- Test with a new PR - Create a simple test PR to trigger detection
See Troubleshooting for more solutions.
Next Steps
- Configure flag detection for custom flag patterns
- Enable branch protection for better tracking
- Set up team workflows for larger teams