Fix OneLoc GitHub App installation selection - #68696
Open
missymessa wants to merge 1 commit into
Open
Conversation
Sync the corrected App installation selection from dotnet/dotnet so OneLoc mints the requested organization installation token. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes GitHub App installation selection in the OneLoc token-minting script so it reliably chooses the requested installation owner (e.g., dotnet) instead of accidentally using the first installation returned by the GitHub API, which can lead to 403 “Resource not accessible by integration” when creating branches or updating PRs.
Changes:
- Ensures the GitHub installations API response is assigned before array-wrapping to avoid nested/incorrect enumeration behavior.
- Filters installations by owner and requires exactly one match (errors on zero or multiple matches).
- Logs the selected installation ID and owner for easier diagnosis in pipeline logs.
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
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.
OneLoc currently receives a token for the first GitHub App installation (microsoft) instead of selecting the requested dotnet installation. That causes 403 Resource not accessible by integration when localization tries to create locfiles/* branches or update PRs.
This syncs the focused installation-selection fix already merged in dotnet/arcade#17312 and propagated to dotnet/dotnet main. It flattens the installations response before filtering, requires exactly one owner match, and logs the selected installation.
Evidence: