Skip to content

Add fallback-org support to GitHub App token manager#174

Merged
jrobotham-square merged 1 commit intomainfrom
fallback-org-token
Mar 11, 2026
Merged

Add fallback-org support to GitHub App token manager#174
jrobotham-square merged 1 commit intomainfrom
fallback-org-token

Conversation

@jrobotham-square
Copy link
Contributor

When a request is made for an org without its own GitHub App installation, the token manager now falls back to the configured fallback org's token. This ensures authenticated rate limits (5000+/hr) instead of unauthenticated limits (60/hr per IP).

Without this, upstream fetches for repos like cashapp/hermit-packages hit unauthenticated rate limits when all workstations share the same IP, causing git fetch timeouts during workstation bootstrap.

Usage

github-app {
  app-id = "12345"
  private-key-path = "/path/to/key.pem"
  installations = { "squareup" : "inst-123" }
  fallback-org = "squareup"
}

When a request is made for an org without its own GitHub App installation,
the token manager now falls back to the configured fallback org's token.
This ensures authenticated rate limits (5000+/hr) instead of
unauthenticated limits (60/hr per IP) for repos in orgs like cashapp
that don't have their own installation.

Without this, upstream fetches for repos like cashapp/hermit-packages
hit unauthenticated rate limits when all workstations share the same IP,
causing git fetch timeouts during workstation bootstrap.

Amp-Thread-ID: https://ampcode.com/threads/T-019cdadf-aa5e-7715-b1d2-86a51b6938c8
Co-authored-by: Amp <amp@ampcode.com>
@jrobotham-square jrobotham-square marked this pull request as ready for review March 11, 2026 03:51
@jrobotham-square jrobotham-square requested a review from a team as a code owner March 11, 2026 03:51
@jrobotham-square jrobotham-square requested review from worstell and removed request for a team March 11, 2026 03:51
@jrobotham-square jrobotham-square merged commit b8f8acd into main Mar 11, 2026
6 checks passed
@jrobotham-square jrobotham-square deleted the fallback-org-token branch March 11, 2026 04:05
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