GitHub
Connect GitHub repositories as Rebase source backing and GitOps primitives.
GitHub is the source-backing integration for Rebase Platform. It lets a workspace or project point at a GitHub repository so deployed Rebase functions, workflows, ASGI apps, and models can be tied back to committed source.
The integration is the primitive for Rebase GitOps: Rebase records the repository, path, commit, branch, and dirty state needed to reason about what source produced an immutable version.
What It Provides
| Capability | Behavior |
|---|---|
| GitHub App installation | Rebase uses a GitHub App installation instead of user personal access tokens. |
| Repository connection | A workspace or one project can be connected to a specific repository and optional path. |
| Source backing | Connected repositories enable workspace_repo and project_repo source modes. |
| Deploy provenance | GitHub-backed deploys require a clean committed source file and store the commit metadata on the immutable Rebase version. |
| Protected deploys | GitOps-protected environments create deployment requests from committed Git source instead of direct local deploys. |
| Starter workflow | Rebase can create a starter workflow file in the connected repository through the GitHub App. |
Setup
Run the GitHub connection wizard after rebase setup has saved a workspace profile:
rebase connect github --repo rebase-energy/platform-workflows --repo-scope workspaceFor a new workspace, create the workspace first:
rebase workspace create energy-team
rebase connect github --repo rebase-energy/platform-workflowsThe connection wizard asks whether the repository should be connected at workspace or project scope, then opens the Rebase GitHub App installation page. Choose Only select repositories in GitHub and select the repository Rebase should use.
If the repository does not exist yet, pass --create-repo to open GitHub's new-repository page before installing the app:
rebase connect github --create-repoRepository Scopes
GitHub connections can be scoped in two ways:
| Scope | Use it when | Source mode |
|---|---|---|
| Workspace | One repository backs the workspace, and projects map to folders inside it. | workspace_repo |
| Project | Each project can use its own repository. | project_repo |
For a workspace repository layout, configure the workspace once and give each project a path:
import rebase as rb
rb.update_workspace(
source_mode="workspace_repo",
repo_owner="rebase-energy",
repo_name="platform-workflows",
)
project = rb.project(
"energy-forecasting",
source_mode="workspace_repo",
repo_path="projects/energy-forecasting",
)GitHub-Backed Deploys
Rebase-hosted source remains the default. To deploy from GitHub-backed source, opt in with deploy_source="github" or the CLI --source github flag:
project.deploy(deploy_source="github")rebase deploy workflow.py --source githubGitHub-backed deploys require:
| Requirement | Why it matters |
|---|---|
| Connected repository | The workspace or project must already have a GitHub repo connection. |
| Source file inside the repo | Rebase stores the source path relative to the repository root. |
| Clean committed file | Rebase records a commit SHA and rejects dirty GitHub-backed deploys. |
| Matching repo metadata | Submitted repo_owner, repo_name, and repo_path must match the configured connection. |
Rebase still creates immutable versions for deployed targets. GitHub provides source provenance and a GitOps anchor; Rebase stores the version record, execution metadata, run history, and endpoint linkage.
GitOps-Protected Deploys
Environment policies use the GitHub connection for GitOps rigor. New workspaces default to direct deploys for dev and GitOps-protected deploys for staging and prod.
rebase environment list
rebase deploy deploy.py --env prodFor a protected environment, rebase deploy checks that the deploy file is in the connected GitHub repository, requires the file to be clean and committed, creates a GitOps deployment request, and returns a GitHub PR or compare URL for review.
rebase deploy deploy.py --env prod --planUse --plan to inspect the source repo, source path, branch, and commit Rebase would use without creating the request.
Manage policies with:
rebase environment protect prod --allowed-branch main
rebase environment unprotect devSee GitOps Deployments for the deployment-mode model.
API Flow
The connection wizard uses the GitHub integration API behind the scenes:
| Step | API behavior |
|---|---|
| Create setup session | Rebase creates a pending setup session and returns a GitHub App installation URL with a state token. |
| Install app | GitHub redirects back to Rebase with the state and installation ID. |
| Record installation | Rebase stores the GitHub App installation account and marks the setup session installed. |
| Connect repo | Rebase verifies that the repository is accessible to the installation, then stores a workspace or project repo connection. |
| Apply source mode | Workspace connections update the workspace to workspace_repo; project connections update that project to project_repo. |
The same API can list repositories visible to an installation, find the installation for a repository, list active repo connections, connect a repository, and create a starter workflow file.
Reference
See rebase connect, rebase workspace create, rebase.update_workspace, and rebase.Project for the user-facing commands and SDK parameters.

