Skip to content

Fix OneLoc GitHub App installation selection - #68696

Open
missymessa wants to merge 1 commit into
dotnet:mainfrom
missymessa:fix-oneloc-github-app-installation-selection
Open

Fix OneLoc GitHub App installation selection#68696
missymessa wants to merge 1 commit into
dotnet:mainfrom
missymessa:fix-oneloc-github-app-installation-selection

Conversation

@missymessa

Copy link
Copy Markdown
Member

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:

  • The App-token step succeeds, but OneLoc branch/PR writes fail with 403.
  • Replaying the same operation with the correctly selected dotnet installation token succeeds.
  • The change is limited to �ng/common/Get-GitHubAppToken.ps1 (14 insertions, 4 deletions).

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>
Copilot AI lite review requested due to automatic review settings August 21, 2026 15:48
@missymessa
missymessa requested review from a team and wtgodbe as code owners August 21, 2026 15:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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