feat: dynamically discover GitHub App installations via API#203
Merged
jrobotham-square merged 1 commit intomainfrom Mar 20, 2026
Merged
feat: dynamically discover GitHub App installations via API#203jrobotham-square merged 1 commit intomainfrom
jrobotham-square merged 1 commit intomainfrom
Conversation
ba6e2b4 to
ef33bea
Compare
Instead of requiring org installation IDs to be statically configured in
cachew.hcl, dynamically resolve them by querying the GitHub API
(GET /orgs/{org}/installation, falling back to /users/{user}/installation).
Removes the static Installations map from Config entirely. Installation
IDs are discovered on first use and cached in memory. The fallback-org
config is retained for orgs where the app is not installed.
This fixes clone failures for orgs like AfterpayTouch where the GitHub
App is installed but the installation ID wasn't in the config. Ports the
same approach used in blox's internal/github/app_auth.go.
Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d0910-4486-750f-bb6b-0629397da303
ef33bea to
86db55c
Compare
stuartwdouglas
approved these changes
Mar 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of requiring all org installation IDs to be statically configured in
cachew.hcl, dynamically resolve them by querying the GitHub API (GET /orgs/{org}/installation, falling back to/users/{user}/installation).Static installations config still works and is checked first. Dynamic discovery only triggers for orgs not in the static map. Results are cached in memory for subsequent requests.
This fixes clone failures for orgs like
AfterpayTouchwhere the GitHub App is installed but the installation ID wasn't in the config. Ports the same approach used in blox'sinternal/github/app_auth.go.