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

# GitHub

> Prepare the GitOps repo and the Sariva platform token. AWS access is configured later under Access & state setup.

ⓘINFO

**Setup wizard → GitOps repo.** This page prepares the GitHub repo and the token used by the Sariva platform pod to open pull requests. The AWS role that GitHub Actions assumes is configured later under [AWS S3/DynamoDB state with GitHub Actions](https://sariva.mintlify.site/install-setup/access-and-state/aws-github-actions.md).

Sariva proposes infrastructure changes as pull requests to a Git repository you own. Your CI then runs Terraform.

This page covers only GitHub prerequisites:

1. the GitOps repository, and
2. the Sariva platform's GitHub token.

The AWS state backend and GitHub Actions IAM role are not configured here. For the current AWS + GitHub Actions path, those commands live in [AWS + GitHub Actions](https://sariva.mintlify.site/install-setup/access-and-state/aws-github-actions.md).

## 1. Create or choose the GitOps repo

Use an existing private repo or create a new private repo. Sariva does not create the repo.

Recommended settings:

* private repository
* default branch: `main`
* branch protection on `main`
* PR required before merge
* status checks required before merge
* CODEOWNERS for the platform team
* no direct pushes to `main`

Save the repo name in this format:

```text theme={null}
<owner>/<repo>
```

Example:

```text theme={null}
acme-platform/sariva-gitops
```

## 2. Create the Sariva platform GitHub token

This token is used by the Sariva platform pod to open and update GitOps pull requests.

Use a **fine-grained personal access token** scoped to only this repo.

**1. Open fine-grained tokens**

GitHub → your avatar → **Settings → Developer settings → Personal access tokens → Fine-grained tokens** → **Generate new token**.

**2. Limit it to the GitOps repo**

Choose the resource owner, then select **Only select repositories** and pick the GitOps repo.

**3. Set repository permissions**

Grant the permissions in the table below and generate the token. Copy it immediately; GitHub shows it once.

| GitHub permission | Access | Why |
| - | - | - |
| Contents | Read and write | Commit Terraform changes to the PR branch |
| Pull requests | Read and write | Open and update PRs |
| Actions | Read-only | Watch workflow runs when the watcher is enabled |
| Metadata | Read-only | Auto-required by GitHub |

⚠WARNING

Do **not** grant `Workflows: write` to the Sariva platform token. Sariva never writes directly to `.github/workflows/`. You manually review and copy generated workflow templates during infrastructure bootstrap.

Save the token as:

```text theme={null}
GITHUB_TOKEN=<your-fine-grained-token>
```

You will paste it in after the setup wizard runs — into `setup-secret.sh` on the Kubernetes paths, or as the `GITHUB_TOKEN=` line in `.env` on the [Linux VM (Docker) path](https://sariva.mintlify.site/deploy/vm-docker-cc.md#5-fill-the-env).

## 3. What this token is not

This token is not the AWS credential for GitHub Actions.

There are two different GitHub-related credentials:

| Credential | Used by | Purpose | Where configured |
| - | - | - | - |
| `GITHUB_TOKEN` | Sariva platform | Open/update PRs and optionally read workflow status | `setup-secret.sh` → Kubernetes Secret (Helm paths) · `.env` (VM path) |
| `AWS_ROLE_TO_ASSUME` | GitHub Actions workflow | Assume AWS IAM role to access S3/DynamoDB Terraform state | GitHub Actions secret |

## Continue the deployment path

> [card] [Next: LLM backend](https://sariva.mintlify.site/prerequisites/llm-backend.md)
>
> Choose the platform's LLM backend — Claude API, Ollama, or AWS Bedrock.

> [card] [Back to the AWS EKS path](https://sariva.mintlify.site/deploy/aws-eks-cc.md)
>
> Return to the EKS path map to confirm where this step fits.

> [card] [Back to the VM path](https://sariva.mintlify.site/deploy/vm-docker-cc.md)
>
> Running on a Linux VM? Return to the VM checklist.


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