Skip to content

github: support multi-org GitHub App installations#1

Merged
patrickod merged 1 commit into
mainfrom
patrickod/multi-org
Jun 5, 2026
Merged

github: support multi-org GitHub App installations#1
patrickod merged 1 commit into
mainfrom
patrickod/multi-org

Conversation

@patrickod
Copy link
Copy Markdown
Contributor

Replace the single-installation gitBasicAuthTransport with a multiOrgTransport that discovers and caches per-org GitHub App installations. At startup, GET /app/installations enumerates all orgs the App is installed on and pre-populates the cache. On cache miss (new org installed after startup), the transport lazily calls GET /orgs/{org}/installation.

The org is extracted from the request URL path (first path segment, lowercased) and matched to the correct installation token, which is set as HTTP basic auth for GitHub's git smart HTTP endpoints.

This removes the --github-app-install-id flag; all installations are now discovered dynamically from the GitHub API.

@patrickod patrickod requested a review from bradfitz June 4, 2026 23:45
@patrickod patrickod force-pushed the patrickod/multi-org branch from c79933e to 1a73526 Compare June 5, 2026 00:25
Comment thread github.go Outdated
Comment thread github.go
Replace the single-installation gitBasicAuthTransport with a
multiOrgTransport that discovers and caches per-org GitHub App
installations. At startup, GET /app/installations enumerates all
orgs the App is installed on and pre-populates the cache. On cache
miss (new org installed after startup), the transport lazily calls
GET /orgs/{org}/installation.

The org is extracted from the request URL path (first path segment,
lowercased) and matched to the correct installation token, which is
set as HTTP basic auth for GitHub's git smart HTTP endpoints.

This removes the --github-app-install-id flag; all installations
are now discovered dynamically from the GitHub API.

Signed-off-by: Patrick O'Doherty <patrick@tailscale.com>
@patrickod patrickod force-pushed the patrickod/multi-org branch from 1a73526 to bc425d1 Compare June 5, 2026 17:06
@patrickod patrickod merged commit e9a1b78 into main Jun 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants