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

# GitHub Integration Overview

> Enable GitOps workflows with GitHub integration

## What is GitHub Integration?

GitHub integration allows you to edit Kubernetes YAML files and create Pull Requests directly from Orphelix, following GitOps best practices.

![GitHub Integration](https://mintlify.s3.us-west-1.amazonaws.com/orphelix/images/github-integration.png)

## Benefits

> [card] GitOps Workflow
>
> Follow GitOps best practices with version-controlled infrastructure

> [card] YAML Editor
>
> Edit Kubernetes manifests with Monaco editor and syntax highlighting

> [card] Pull Requests
>
> Automatically create and manage PRs from the dashboard

> [card] Kustomize Support
>
> Detect and edit Kustomize base & overlay structures

## Features

### YAML Editing

* **Monaco Editor** - VSCode-like editing experience
* **Syntax Highlighting** - YAML and Kubernetes schema validation
* **Auto-completion** - Smart suggestions for Kubernetes resources
* **Error Detection** - Real-time validation of YAML syntax

### Smart File Matching

> [!NOTE]
>
> Orphelix can automatically find the correct YAML file for each deployment using AI-powered matching

Two matching methods:

1. **AI-Powered (OpenAI)** - Uses GPT-4o-mini to intelligently match deployments to files
2. **Pattern-based** - Fallback method using naming patterns

### Pull Request Workflow

**1. Edit YAML**

Make changes in the Monaco editor

**2. Save Changes**

Click "Create Pull Request"

**3. Automatic PR**

Orphelix creates a PR with your changes

**4. Review & Merge**

Review in GitHub, then merge when ready

## Authentication Methods

> [tab] GitHub App (Recommended)
>
> ### Why GitHub App?
>
> > [accordion] More Secure
> >
> > Fine-grained repository access - choose exactly which repos to grant access
>
> > [accordion] Organization-Friendly
> >
> > Centralized permission management, no personal tokens
>
> > [accordion] Better Rate Limits
> >
> > Higher API rate limits than OAuth
>
> > [accordion] Independent Identity
> >
> > App has its own identity, not tied to a personal account
>
> **Setup:** See [GitHub App Setup](https://orphelix.mintlify.site/user/github/github-app-setup.md)

> [tab] OAuth (Legacy)
>
> ### OAuth Authentication
>
> Traditional OAuth flow with full repository access.
>
> > [!WARNING]
> >
> > OAuth requires granting access to ALL repositories. GitHub App is recommended for better security.
>
> **Features:**
>
> * Simpler setup process
> * Works with personal repositories
> * Immediate access after authorization
>
> **Limitations:**
>
> * All-or-nothing repository access
> * Lower API rate limits
> * Tied to personal GitHub account

## Use Cases

### 1. Update Deployment Image

```yaml theme={null}
# Before
spec:
  containers:
  - name: app
    image: myapp:v1.0.0

# After (edit in Orphelix)
spec:
  containers:
  - name: app
    image: myapp:v1.1.0
```

### 2. Adjust Resource Limits

```yaml theme={null}
# Edit resources directly in dashboard
resources:
  limits:
    memory: "1Gi"    # Updated from 512Mi
    cpu: "1000m"     # Updated from 500m
  requests:
    memory: "512Mi"
    cpu: "250m"
```

### 3. Update ConfigMap Values

```yaml theme={null}
# Edit configuration without kubectl
data:
  APP_ENV: "production"
  LOG_LEVEL: "info"    # Updated from "debug"
  CACHE_TTL: "3600"    # Added new config
```

## Requirements

**1. GitHub Account**

Personal or organization account

**2. Repository Access**

Read/write access to your Kubernetes manifests repository

**3. OpenAI API Key (Optional)**

For AI-powered file matching (recommended but not required)

## Getting Started

> [card] [Set up GitHub App](https://orphelix.mintlify.site/user/github/github-app-setup.md)
>
> Recommended method for secure integration

> [card] [Use YAML Editor](https://orphelix.mintlify.site/user/github/yaml-editor.md)
>
> Learn how to edit Kubernetes manifests

> [card] [Create Pull Requests](https://orphelix.mintlify.site/user/github/pull-requests.md)
>
> Manage PRs from the dashboard

## Security

> [accordion] Credentials Storage
>
> * GitHub App tokens stored in HTTP-only cookies
> * Tokens never exposed to browser JavaScript
> * Automatic token refresh every 8 hours

> [accordion] Repository Access
>
> * Granular repository permissions
> * Read + Write access only to selected repos
> * Can revoke access anytime from GitHub settings

> [accordion] API Security
>
> * All GitHub API calls server-side
> * No direct browser-to-GitHub communication
> * Rate limiting protection

## FAQ

> [accordion] Can I use multiple GitHub accounts?
>
> Yes! You can install the GitHub App on multiple accounts (personal + organizations) and switch between them in the repository selector.

> [accordion] What permissions does the GitHub App need?
>
> * **Contents**: Read and write (to read/edit files)
> * **Pull Requests**: Read and write (to create PRs)
> * **Metadata**: Read-only (automatically set by GitHub)

> [accordion] Can I edit files in private repositories?
>
> Yes! GitHub App works with both public and private repositories.

> [accordion] What if my repo uses Kustomize?
>
> Orphelix automatically detects Kustomize structure and shows base + overlay files in separate tabs.

## Next Steps

> [card] [Set up GitHub App](https://orphelix.mintlify.site/user/github/github-app-setup.md)
>
> Follow the step-by-step setup guide


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